Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/source/user_guide/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,21 @@ the number of groups, which is the same as the length of the ``groups`` dictiona
grouped.groups
len(grouped)

Iterating over GroupBy
----------------------

A ``GroupBy`` object can be iterated as ``(key, group)`` pairs,
where each ``key`` represents the group name and ``group`` is a
DataFrame containing the rows of that group.

Example:
::

for key, group in df.groupby("A"):
print(key)
print(group)



.. _groupby.tabcompletion:

Expand Down