polars.Series.arg_sort
-
Get the index values that would sort this Series.
- Parameters:
-
- descending
-
Sort in descending order.
- nulls_last
-
Place null values last instead of first.
See also
-
Series.gather -
Take values by index.
-
Series.rank -
Get the rank of each row.
Examples
>>> s = pl.Series("a", [5, 3, 4, 1, 2]) >>> s.arg_sort() shape: (5,) Series: 'a' [u32] [ 3 4 1 2 0 ]
Series.arg_sort(
*,
descending: bool = False,
nulls_last: bool = False,
) → Series
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.arg_sort.html