id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 178200674,MDU6SXNzdWUxNzgyMDA2NzQ=,1013,Groupby exclude dimension,4295853,open,0,,,8,2016-09-20T22:48:46Z,2020-10-04T16:05:06Z,,CONTRIBUTOR,,,,"Is there some way to do a groupby operation where some dimension is excluded from the operation, e.g., a vectorized version of something like this: ``` python vertlevels = [ds.vel.sel(nVertLevels=i).groupby('y').mean() for i in ds.nVertLevels] xavgvel = xr.concat(vertlevels, 'nVertLevels') ``` The application here is to average 3D data in the x coordinate to the unique y coordinates, but not the vertical coordinate. Thus, we are basically looking for something that allows a coordinate to be excluded from the groupby operation, e.g., in this case the vertical coordinate. Ideally this would also be possible within the context of the `groupby_bins` operation. Any ideas on how this should work or a pointer on how to implement this type of operation more cleanly with existing infrastructure is greatly appreciated. This appears to be related to #324 and especially (perhaps identically) #924. cc @vanroekel, @shoyer, @jhamman, @rabernat, @MaximilianR ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/1013/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 217584777,MDU6SXNzdWUyMTc1ODQ3Nzc=,1335,`cumsum` providing correct behavior for non-coordinate DataArrays?,4295853,open,0,,,5,2017-03-28T14:45:12Z,2019-03-31T05:41:09Z,,CONTRIBUTOR,,,,"In the case of a DataArray without coordinates, should cumsum work without specifying an axis, e.g., `da.cumsum()` is valid? This is not currently the obtained behavior. ```python In [1]: import xarray as xr imp In [2]: import numpy as np In [3]: da = xr.DataArray(np.arange(10)) In [4]: da Out[4]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) Dimensions without coordinates: dim_0 In [5]: da.cumsum(axis=0) Out[5]: array([ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45]) Dimensions without coordinates: dim_0 In [6]: da.cumsum() --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in () ----> 1 da.cumsum() /Users/pwolfram/src/xarray/xarray/core/common.pyc in wrapped_func(self, dim, axis, skipna, keep_attrs, **kwargs) 17 keep_attrs=False, **kwargs): 18 return self.reduce(func, dim, axis, keep_attrs=keep_attrs, ---> 19 skipna=skipna, allow_lazy=True, **kwargs) 20 else: 21 def wrapped_func(self, dim=None, axis=None, keep_attrs=False, /Users/pwolfram/src/xarray/xarray/core/dataarray.pyc in reduce(self, func, dim, axis, keep_attrs, **kwargs) 1146 summarized data and the indicated dimension(s) removed. 1147 """""" -> 1148 var = self.variable.reduce(func, dim, axis, keep_attrs, **kwargs) 1149 return self._replace_maybe_drop_dims(var) 1150 /Users/pwolfram/src/xarray/xarray/core/variable.pyc in reduce(self, func, dim, axis, keep_attrs, allow_lazy, **kwargs) 898 if dim is None and axis is None: 899 raise ValueError(""must supply either single 'dim' or 'axis' "" --> 900 ""argument to %s"" % (func.__name__)) 901 902 if dim is not None: ValueError: must supply either single 'dim' or 'axis' argument to cumsum ```","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/1335/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue