summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-02-23 15:10:58 +0000
committerEric Wieser <wieser.eric@gmail.com>2017-03-07 17:33:23 +0000
commit821293d73fb6f62a9304c744a6144b43a853ba81 (patch)
tree94f45a21264ea5ce58cad1750738664f5f720705 /numpy/ma
parent8e83849f4412cd00501251c58902fba4f9e4b60a (diff)
downloadnumpy-821293d73fb6f62a9304c744a6144b43a853ba81.tar.gz
MAINT: Remove duplicated code between sort and argsort
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/core.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 52e558fc1..32e226c43 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5449,20 +5449,9 @@ class MaskedArray(ndarray):
if self is masked:
return
- if fill_value is None:
- if endwith:
- # nan > inf
- if np.issubdtype(self.dtype, np.floating):
- filler = np.nan
- else:
- filler = minimum_fill_value(self)
- else:
- filler = maximum_fill_value(self)
- else:
- filler = fill_value
+ sidx = self.argsort(axis=axis, kind=kind, order=order,
+ fill_value=fill_value, endwith=endwith)
- sidx = self.filled(filler).argsort(axis=axis, kind=kind,
- order=order)
# save meshgrid memory for 1d arrays
if self.ndim == 1:
idx = sidx