argSort style.argSortOf
fn
size_t[] argSortOf(Series series, bool descending = false,
bool nullsLast = false)Sorts the indices of a Series by its values.
The valid entries sort as (key, index) pairs with the index tie-break always applied, so equal keys keep their original order (stability); the null indices partition out and go before the valid ones (nullsLast = false, the Polars default) or after them. Floats compare with the total order (NaN greatest, -0.0 equal to 0.0).
Parameters
series | the key column |
descending | largest keys first |
nullsLast | nulls after the valid entries instead of before |
Returns
the permutation that sorts the column,