NumPy · Function
np.argsort
Returns the indices that would sort an array. It sorts along a chosen axis and can preserve the order of equal values or sort in descending order.
Last updated
- Since
- 2.0.0 for stable; 2.5.0 for descending
Syntax
numpy.argsort(a, axis=-1, kind=None, order=None, *, stable=None, descending=<no value>)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
sortlexsortndarray.sortargpartitiontake_along_axis