pyarrow.compute.sort_indices

pyarrow.compute.sort_indices(input, *, memory_pool=None, options=None, sort_keys=None)

Return the indices that would sort an array, record batch or table.

This function computes an array of indices that define a stable sort of the input array, record batch or table. Null values are considered greater than any other value and are therefore sorted at the end of the input. For floating-point types, NaNs are considered greater than any other non-null value, but smaller than null values.

Parameters
  • input (Array-like or scalar-like) – Argument to compute function

  • memory_pool (pyarrow.MemoryPool, optional) – If not passed, will allocate memory from the default memory pool.

  • options (pyarrow.compute.SortOptions, optional) – Parameters altering compute function semantics

  • **kwargs (optional) – Parameters for SortOptions constructor. Either options or **kwargs can be passed, but not both at the same time.