scipp.allsorted#

scipp.allsorted(x, dim, order='ascending')#

Check if all values of a variable are sorted.

  • If order is ‘ascending’, check if values are non-decreasing along dim.

  • If order is ‘descending’, check if values are non-increasing along dim.

Parameters:
  • x (Variable | DataGroup) – Variable to check.

  • dim (str) – Dimension along which order is checked.

  • order (Literal['ascending', 'descending'], default: 'ascending') – Sorting order.

Returns:

bool | DataGroup – True if the variable values are monotonously ascending or descending (depending on the requested order), False otherwise.

See also

scipp.issorted