Skip to main content

sort

Function sort 

Source
pub fn sort<T, D>(
    a: &Array<T, D>,
    axis: Option<usize>,
    kind: SortKind,
) -> FerrayResult<Array<T, IxDyn>>
where T: Element + PartialOrd + Copy + Send + Sync, D: Dimension,
Expand description

Sort an array along the given axis (or flattened if axis is None).

When axis is None, the array is flattened before sorting and a 1-D array is returned. When an axis is given, the returned array has the same shape as the input.

Note: NumPy’s np.sort(a) defaults to axis=-1 (last axis). ferray’s sort(a, None, kind) flattens instead. To match NumPy’s default, pass the last axis explicitly: sort(a, Some(a.ndim() - 1), kind).

Equivalent to numpy.sort.