MaskedArray.argsort(axis=None, kind='quicksort', order=None, fill_value=None)
[source]
Return an ndarray of indices that sort the array along the specified axis. Masked values are filled beforehand to fill_value
.
Parameters: |
axis : int, optional Axis along which to sort. The default is -1 (last axis). If None, the flattened array is used. fill_value : var, optional Value used to fill the array before sorting. The default is the kind : {‘quicksort’, ‘mergesort’, ‘heapsort’}, optional Sorting algorithm. order : list, optional When |
---|---|
Returns: |
index_array : ndarray, int Array of indices that sort |
See also
sort
lexsort
ndarray.sort
See sort
for notes on the different sorting algorithms.
>>> a = np.ma.array([3,2,1], mask=[False, False, True]) >>> a masked_array(data = [3 2 --], mask = [False False True], fill_value = 999999) >>> a.argsort() array([1, 0, 2])
© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.ma.MaskedArray.argsort.html