polars.Series.is_sorted
-
Check if the Series is sorted.
- Parameters:
-
- descending
-
Check if the Series is sorted in descending order
- nulls_last
-
Set nulls at the end of the Series in sorted check.
Examples
>>> s = pl.Series([1, 3, 2]) >>> s.is_sorted() False
>>> s = pl.Series([3, 2, 1]) >>> s.is_sorted(descending=True) True
Series.is_sorted(
*,
descending: bool = False,
nulls_last: bool = False,
) → bool
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.is_sorted.html