File tree 1 file changed +6
-16
lines changed
1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -177,28 +177,18 @@ This last line is roughly equivalent to the following::
177
177
results.append(group - alt.sel(letters=label))
178
178
xr.concat(results, dim='x')
179
179
180
- Squeezing
181
- ~~~~~~~~~
180
+ Iterating and Squeezing
181
+ ~~~~~~~~~~~~~~~~~~~~~~~
182
182
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.
190
187
191
188
.. ipython :: python
192
189
193
190
next (iter (arr.groupby(" x" , squeeze = False )))
194
191
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.
202
192
203
193
.. _groupby.multidim :
204
194
You can’t perform that action at this time.
0 commit comments