@@ -116,7 +116,13 @@ dimensions *other than* the provided one:
116
116
117
117
.. ipython :: python
118
118
119
- ds.groupby(' x' ).std(xr.ALL_DIMS )
119
+ ds.groupby(' x' ).std(... )
120
+
121
+ .. note ::
122
+
123
+ We use an ellipsis (`... `) here to indicate we want to reduce over all
124
+ other dimensions
125
+
120
126
121
127
First and last
122
128
~~~~~~~~~~~~~~
@@ -127,7 +133,7 @@ values for group along the grouped dimension:
127
133
128
134
.. ipython :: python
129
135
130
- ds.groupby(' letters' ).first(xr. ALL_DIMS )
136
+ ds.groupby(' letters' ).first(... )
131
137
132
138
By default, they skip missing values (control this with ``skipna ``).
133
139
@@ -142,7 +148,7 @@ coordinates. For example:
142
148
143
149
.. ipython :: python
144
150
145
- alt = arr.groupby(' letters' ).mean(xr. ALL_DIMS )
151
+ alt = arr.groupby(' letters' ).mean(... )
146
152
alt
147
153
ds.groupby(' letters' ) - alt
148
154
@@ -195,7 +201,7 @@ __ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimen
195
201
' lat' : ([' ny' ,' nx' ], [[10 ,10 ],[20 ,20 ]] ),},
196
202
dims = [' ny' ,' nx' ])
197
203
da
198
- da.groupby(' lon' ).sum(xr. ALL_DIMS )
204
+ da.groupby(' lon' ).sum(... )
199
205
da.groupby(' lon' ).apply(lambda x : x - x.mean(), shortcut = False )
200
206
201
207
Because multidimensional groups have the ability to generate a very large
@@ -213,4 +219,4 @@ applying your function, and then unstacking the result:
213
219
.. ipython :: python
214
220
215
221
stacked = da.stack(gridcell = [' ny' , ' nx' ])
216
- stacked.groupby(' gridcell' ).sum(xr. ALL_DIMS ).unstack(' gridcell' )
222
+ stacked.groupby(' gridcell' ).sum(... ).unstack(' gridcell' )
0 commit comments