Function sort_by_key

Source
pub fn sort_by_key<K, V>(
    keys: &Array<K>,
    vals: &Array<V>,
    dim: u32,
    ascending: bool,
) -> (Array<K>, Array<V>)
Expand description

Sort the values in input Arrays

Sort an multidimensional Array based on keys

§Parameters

  • keys - Array with key values
  • vals - Array with input values
  • dim - Dimension along which to sort
  • ascending - Sorted output will have ascending values if True and descending order otherwise.

§Return Values

A tuple of Arrays.

The first Array contains the keys based on sorted values.

The second Array contains the sorted values.