Skip to content

Commit

Permalink
docs(python): Update GroupBy.__iter__ docstring to match new behavi…
Browse files Browse the repository at this point in the history
…or (#17383)
  • Loading branch information
stinodego authored Jul 3, 2024
1 parent 663fe4c commit 60fa8db
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions py-polars/polars/dataframe/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ def __iter__(self) -> Self:
Allows iteration over the groups of the group by operation.
Each group is represented by a tuple of `(name, data)`. The group names are
tuples of the distinct group values that identify each group. If a single string
was passed to `by`, the keys are a single value instead of a tuple.
tuples of the distinct group values that identify each group.
Examples
--------
>>> df = pl.DataFrame({"foo": ["a", "a", "b"], "bar": [1, 2, 3]})
>>> for name, data in df.group_by(["foo"]): # doctest: +SKIP
>>> for name, data in df.group_by("foo"): # doctest: +SKIP
... print(name)
... print(data)
(a,)
Expand Down

0 comments on commit 60fa8db

Please sign in to comment.