pub fn sort(a: &Array, axis: Option<isize>) -> Result<Array>Expand description
a sorted along axis (flattened without one): ascending, stable, NaN last.
use nuvec_core::{Array, Result, argsort, sort};
let a = Array::from_slice(&[3.0f32, f32::NAN, 1.0, 2.0], &[4])?;
assert_eq!(sort(&a, Some(0))?.to_vec::<f32>()?[..3], [1.0, 2.0, 3.0]);
assert_eq!(argsort(&a, Some(0))?.to_vec::<u32>()?, [2, 3, 0, 1]);