dpnp.argsort
- dpnp.argsort(in_array1, axis=- 1, kind=None, order=None)[source]
Returns the indices that would sort an array.
For full documentation refer to
numpy.argsort
.Limitations
Input array is supported as
dpnp.ndarray
. Otherwise the function will be executed sequentially on CPU. Prametersaxis
is supported only with default value-1
. Prameterskind
is supported only with default valueNone
. Prametersorder
is supported only with default valueNone
. Input array data types are limited by supported DPNP Data types.See also
dpnp.sort
Describes sorting algorithms used.
dpnp.lexsort
Indirect stable sort with multiple keys.
dpnp.argpartition
Indirect partial sort.
dpnp.take_along_axis
Apply
index_array
from argsort to an array as if by calling sort.
Examples
>>> import dpnp as np >>> x = np.array([3, 1, 2]) >>> out = np.argsort(x) >>> [i for i in out] [1, 2, 0]