Skip to content

ENH: add nanmin#804

Open
OmarManzoor wants to merge 4 commits into
data-apis:mainfrom
OmarManzoor:nan_reductions
Open

ENH: add nanmin#804
OmarManzoor wants to merge 4 commits into
data-apis:mainfrom
OmarManzoor:nan_reductions

Conversation

@OmarManzoor

Copy link
Copy Markdown
Contributor

Towards: #789

  • Adds array API support for nanmin

@OmarManzoor

Copy link
Copy Markdown
Contributor Author

@lucascolley I added one of these for a start. I think after we finalize one of them the others can follow along.

@lucascolley lucascolley self-requested a review June 16, 2026 17:07
@lucascolley lucascolley added enhancement New feature or request new function labels Jun 16, 2026
@lucascolley lucascolley added this to the 0.11.1 milestone Jun 26, 2026

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a few merge conflicts

return a


def nanmin( # numpydoc ignore=PR01,RT01

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whereabouts did you take this implementation from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scikit-learn directly. As for how that is implemented there I am not exactly sure.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to check the history there

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucascolley lucascolley Jun 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks — @betatim would you mind weighing in on how this implementation arose?

EDIT: /feel free to review also :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this mainly follows the numpy implementation ignoring cases of objects or ndarray specifics:
https://github.com/numpy/numpy/blob/main/numpy/lib/_nanfunctions_impl.py#L252-L374

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly are you looking for in terms of histroy Lucas?

My guess is that like Omar said it is based on what is in Numpy, potentially minus some extra args/handling of edge cases.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly are you looking for in terms of histroy Lucas?

My guess is that like Omar said it is based on what is in Numpy, potentially minus some extra args/handling of edge cases.

If that's the case, then yeah, I'll start by looking at what NumPy does

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the way these functions make their way into scikit-learn is "this exists in numpy, doesn't exist in array API, we need it, let's translate the numpy code"

@lucascolley lucascolley self-requested a review June 30, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants