Skip to content

DOC: Added get_group() example to grouby.html #8811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2014
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ If you want to do a full clean build, do::
python make.py build


Staring with 0.13.1 you can tell ``make.py`` to compile only a single section
Starting with 0.13.1 you can tell ``make.py`` to compile only a single section
of the docs, greatly reducing the turn-around time for checking your changes.
You will be prompted to delete `.rst` files that aren't required, since the
last committed version can always be restored from git.
Expand Down
15 changes: 15 additions & 0 deletions doc/source/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,21 @@ In the case of grouping by multiple keys, the group name will be a tuple:
It's standard Python-fu but remember you can unpack the tuple in the for loop
statement if you wish: ``for (k1, k2), group in grouped:``.

Selecting a group
-----------------

A single group can be selected using ``GroupBy.get_group()``:

.. ipython:: python

grouped.get_group('bar')

Or for an object grouped on multiple columns:

.. ipython:: python

df.groupby(['A', 'B']).get_group(('bar', 'one'))

.. _groupby.aggregate:

Aggregation
Expand Down