- sort(x: array, /, *, axis: int = - 1, descending: bool = False, stable: bool = True) array ¶
Returns a sorted copy of an input array
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see Complex Number Ordering).
x (array) – input array. Should have a real-valued data type.
axis (int) – axis along which to sort. If set to
-1, the function must sort along the last axis. Default:
descending (bool) – sort order. If
True, the array must be sorted in descending order (by value). If
False, the array must be sorted in ascending order (by value). Default:
stable (bool) – sort stability. If
True, the returned array must maintain the relative order of
xvalues which compare as equal. If
False, the returned array may or may not maintain the relative order of
xvalues which compare as equal (i.e., the relative order of
xvalues which compare as equal is implementation-dependent). Default:
out (array) – a sorted array. The returned array must have the same data type and shape as