pyarrow.compute.array_sort_indices

pyarrow.compute.array_sort_indices(array, *, memory_pool=None, options=None, order='ascending', null_placement='at_end')

Return the indices that would sort an array.

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

The handling of nulls and NaNs can be changed in ArraySortOptions.

Parameters
  • array (Array-like) – Argument to compute function

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

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

  • order (optional) – Parameter for ArraySortOptions constructor. Either options or order can be passed, but not both at the same time.

  • null_placement (optional) – Parameter for ArraySortOptions constructor. Either options or null_placement can be passed, but not both at the same time.