dpnp.dpnp_array.dpnp_array.sort

method

dpnp_array.sort(axis=-1, kind=None, order=None)[source]

Sort an array in-place.

Refer to dpnp.sort for full documentation.

Note

axis in dpnp.sort could be integer or None. If None, the array is flattened before sorting. However, axis in dpnp.ndarray.sort can only be integer since it sorts an array in-place.

Examples

>>> import dpnp as np
>>> a = np.array([[1,4],[3,1]])
>>> a.sort(axis=1)
>>> a
array([[1, 4],
      [1, 3]])
>>> a.sort(axis=0)
>>> a
array([[1, 1],
      [3, 4]])