Skip to content

Commit

Permalink
Add example to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Aug 17, 2024
1 parent 85607ea commit 2e06afc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions doc/user-guide/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ You can index out a particular group:
ds.groupby("letters")["b"]
Just like in pandas, creating a GroupBy object is cheap: it does not actually
Just like in pandas, creating a ``GroupBy`` object is cheap: it does not actually
split the data until you access particular values.

To group by multiple variables, see the section on `Grouper Objects`_

Binning
~~~~~~~

Expand Down Expand Up @@ -276,7 +278,13 @@ is identical to
ds.groupby(x=UniqueGrouper())
and
We can use this to group by multiple dimensions:

.. ipython:: python
ds.groupby(lat=UniqueGrouper(), lon=UniqueGrouper()).sum()
Similarly,

.. code-block:: python
Expand Down

0 comments on commit 2e06afc

Please sign in to comment.