File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,11 @@ You can index out a particular group:
81
81
82
82
ds.groupby(" letters" )[" b" ]
83
83
84
- Just like in pandas, creating a GroupBy object is cheap: it does not actually
84
+ Just like in pandas, creating a `` GroupBy `` object is cheap: it does not actually
85
85
split the data until you access particular values.
86
86
87
+ To group by multiple variables, see the section on `Grouper Objects `_
88
+
87
89
Binning
88
90
~~~~~~~
89
91
@@ -276,7 +278,15 @@ is identical to
276
278
277
279
ds.groupby(x = UniqueGrouper())
278
280
279
- and
281
+ We can use this to group by multiple dimensions:
282
+
283
+ .. ipython :: python
284
+
285
+ from xarray.groupers import UniqueGrouper
286
+
287
+ ds.groupby(lat = UniqueGrouper(), lon = UniqueGrouper()).sum()
288
+
289
+ Similarly,
280
290
281
291
.. code-block :: python
282
292
You can’t perform that action at this time.
0 commit comments