- pyarrow.compute.sort_indices(input, /, sort_keys=(), *, null_placement='at_end', options=None, memory_pool=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. By default, nNull 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.
The handling of nulls and NaNs can be changed in SortOptions.
- inputArray-like or scalar-like
Argument to compute function.
- sort_keyssequence of (
Names of field/column keys to sort the input on, along with the order each field/column is sorted in. Accepted values for order are “ascending”, “descending”.
str, default “at_end”
Where nulls in input should be sorted, only applying to columns/fields mentioned in sort_keys. Accepted values are “at_start”, “at_end”.
Alternative way of passing options.
If not passed, will allocate memory from the default memory pool.