html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/158#issuecomment-254680423,https://api.github.com/repos/pydata/xarray/issues/158,254680423,MDEyOklzc3VlQ29tbWVudDI1NDY4MDQyMw==,1217238,2016-10-19T00:49:27Z,2016-10-19T00:49:27Z,MEMBER,"This issue dates to very early in the days of xarray, before we even had a direct `DataArray` constructor. I have no idea exactly what I was thinking here. I agree, it would be more consistent and user friendly to pick a default name for the group (maybe `'group'`). Any interest in putting together a PR? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,35682274 https://github.com/pydata/xarray/issues/158#issuecomment-254676127,https://api.github.com/repos/pydata/xarray/issues/158,254676127,MDEyOklzc3VlQ29tbWVudDI1NDY3NjEyNw==,12852539,2016-10-19T00:18:53Z,2016-10-19T00:25:38Z,NONE,"Why won't this be fixed? I think some clarification in the documentation would be useful. Currently they say: > xarray supports “group by” operations with the same API as pandas > [and that the required parameter for Dataset/DataArray.groupby is an] > Array whose unique values should be used to group this array. However, pandas supports grouping by a function or by _any_ array (e.g. it can be a pandas object or a numpy array). The xarray API is narrower than pandas, and has an undocumented requirement of a _**named** DataArray_ (contrasting xarray behaviour of creating default names like ""dim_0"" elsewhere). ``` python import numpy as np data = np.arange(10) + 10 # test data f = lambda x: np.floor_divide(x,2) # grouping key import pandas as pd for key in f, f(data), pd.Series(f(data)): print pd.Series(data).groupby(key).mean().values print pd.DataFrame({'thing':data}).groupby(key).mean().thing.values # these pandas examples are all equivalent import xarray as xr da = xr.DataArray(data) key = xr.DataArray(f(data)) key2 = xr.DataArray(f(data), name='key') print da.groupby(key2).mean().values # this line works print da.groupby(key).mean().values # broken: ValueError: `group` must have a name ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,35682274