polars.Series.set_sorted
-
Flags the Series as ‘sorted’.
Enables downstream code to user fast paths for sorted arrays.
- Parameters:
-
- descending
-
If the
Seriesorder is descending.
Warning
This can lead to incorrect results if this
Seriesis not sorted!! Use with care!Examples
>>> s = pl.Series("a", [1, 2, 3]) >>> s.set_sorted().max() 3
Series.set_sorted(
*,
descending: bool = False,
) → Self
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.set_sorted.html