dpnp.ndarray.sort

method

ndarray.sort(axis=-1, kind=None, order=None)

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]])