Skip to content

Commit

Permalink
docs(python): Add example to polars.Series.flags
Browse files Browse the repository at this point in the history
It is my intention that every feature listed in any
API documentation should have an example. I'm happy
to help make this a reality for Polars.

Fixes #16122
  • Loading branch information
pydanny committed May 8, 2024
1 parent 12b40b9 commit 5ce52d9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions py-polars/polars/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,11 @@ def flags(self) -> dict[str, bool]:
"""
Get flags that are set on the Series.
Returns
-------
dict
Dictionary containing the flag name and the value
Examples
--------
>>> s = pl.Series("a", [1, 2, 3])
>>> s.flags
{'SORTED_ASC': False, 'SORTED_DESC': False}
"""
out = {
"SORTED_ASC": self._s.is_sorted_ascending_flag(),
Expand Down

0 comments on commit 5ce52d9

Please sign in to comment.