Skip to content

TYP: Type MaskedArray.__deepcopy__ and MaskedArray.argsort #29418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 23, 2025

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Jul 22, 2025

order just gets passed down to ndarray.argsort as-is

numpy/numpy/ma/core.py

Lines 5675 to 5695 in 75e86ba

if stable:
raise ValueError(
"`stable` parameter is not supported for masked arrays."
)
# 2017-04-11, Numpy 1.13.0, gh-8701: warn on axis default
if axis is np._NoValue:
axis = _deprecate_argsort_axis(self)
if fill_value is None:
if endwith:
# nan > inf
if np.issubdtype(self.dtype, np.floating):
fill_value = np.nan
else:
fill_value = minimum_fill_value(self)
else:
fill_value = maximum_fill_value(self)
filled = self.filled(fill_value)
return filled.argsort(axis=axis, kind=kind, order=order)

so I've taken the annotation from there and updated the MaskedArray.argsort docstring accordingly

@MarcoGorelli MarcoGorelli marked this pull request as ready for review July 23, 2025 09:46
@jorenham jorenham merged commit 436662e into numpy:main Jul 23, 2025
78 checks passed
@jorenham
Copy link
Member

Thanks Marco :)

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

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy