Skip to content

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 :)

IndifferentArea pushed a commit to IndifferentArea/numpy that referenced this pull request Dec 7, 2025
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