Skip to content
forked from pydata/xarray

Commit 97f1695

Browse files
committed
Fix docs
1 parent 5b33b98 commit 97f1695

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

doc/user-guide/groupby.rst

+6-16
Original file line numberDiff line numberDiff line change
@@ -177,28 +177,18 @@ This last line is roughly equivalent to the following::
177177
results.append(group - alt.sel(letters=label))
178178
xr.concat(results, dim='x')
179179

180-
Squeezing
181-
~~~~~~~~~
180+
Iterating and Squeezing
181+
~~~~~~~~~~~~~~~~~~~~~~~
182182

183-
When grouping over a dimension, you can control whether the dimension is
184-
squeezed out or if it should remain with length one on each group by using
185-
the ``squeeze`` parameter:
186-
187-
.. ipython:: python
188-
189-
next(iter(arr.groupby("x")))
183+
Previously, Xarray defaulted to squeezing out dimensions of size one when iterating over
184+
a GroupBy object. This behaviour is being removed.
185+
You can always squeeze explicitly later with the Dataset or DataArray
186+
:py:meth:`~xarray.DataArray.squeeze` methods.
190187

191188
.. ipython:: python
192189
193190
next(iter(arr.groupby("x", squeeze=False)))
194191
195-
Although xarray will attempt to automatically
196-
:py:attr:`~xarray.DataArray.transpose` dimensions back into their original order
197-
when you use apply, it is sometimes useful to set ``squeeze=False`` to
198-
guarantee that all original dimensions remain unchanged.
199-
200-
You can always squeeze explicitly later with the Dataset or DataArray
201-
:py:meth:`~xarray.DataArray.squeeze` methods.
202192
203193
.. _groupby.multidim:
204194

0 commit comments

Comments
 (0)