Skip to content

ENH: Add missing parameters to the nan<x> functions#20027

Merged
charris merged 6 commits intonumpy:mainfrom
BvB93:nanfunc
Oct 4, 2021
Merged

ENH: Add missing parameters to the nan<x> functions#20027
charris merged 6 commits intonumpy:mainfrom
BvB93:nanfunc

Conversation

@BvB93
Copy link
Copy Markdown
Member

@BvB93 BvB93 commented Oct 4, 2021

Closes #20024

A number of the nan<x> functions previously lacked parameters that werepresent in their <x>-based counterpart,
e.g. the where parameter was present in np.mean but absent from np.nanmean.

This PR thus ports the following (previously missing) parameters to the nan<x> functions:

  • nanmin: initial & where
  • nanmax: initial & where
  • nanargmin: keepdims & out
  • nanargmax: keepdims & out
  • nansum: initial & where
  • nanprod: initial & where
  • nanmean: where
  • nanvar: where
  • nanstd: where

@BvB93 BvB93 added 01 - Enhancement component: numpy.lib 62 - Python API Changes or additions to the Python API. Mailing list should usually be notified. labels Oct 4, 2021
Bas van Beek added 6 commits October 4, 2021 19:04
Comment on lines +1147 to +1148
.. versionadded:: 1.22.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not directly related to this PR, but I noticed #19211 didn't add a versionadded directive.

@charris charris merged commit c231c33 into numpy:main Oct 4, 2021
@charris
Copy link
Copy Markdown
Member

charris commented Oct 4, 2021

Thanks Bas. I was a bit worried about the functions that used _divide_by_count, but they look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

01 - Enhancement 62 - Python API Changes or additions to the Python API. Mailing list should usually be notified. component: numpy.lib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Add missing parameters to the nan<x> functions

2 participants