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 256496917,MDU6SXNzdWUyNTY0OTY5MTc=,1565,Regression: time attributes on PeriodIndex,10050469,open,0,,,12,2017-09-10T09:27:09Z,2021-07-20T18:33:29Z,,MEMBER,,,,"The following used to work with xarray 0.9.5 but doesn't anymore with 0.9.6 or master: ```python import xarray as xr import pandas as pd import numpy as np time = pd.period_range('2000-01', '2000-12', freq='M') da = xr.DataArray(np.arange(12), dims=['time'], coords={'time':time}) da['time.month'] ``` ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) ~/.pyvirtualenvs/py3/lib/python3.5/site-packages/xarray/core/dataarray.py in _getitem_coord(self, key) 458 try: --> 459 var = self._coords[key] 460 except KeyError: KeyError: 'time.month' During handling of the above exception, another exception occurred: AttributeError Traceback (most recent call last) in () 4 time = pd.period_range('2000-01', '2000-12', freq='M') 5 da = xr.DataArray(np.arange(12), dims=['time'], coords={'time':time}) ----> 6 da['time.month'] ~/.pyvirtualenvs/py3/lib/python3.5/site-packages/xarray/core/dataarray.py in __getitem__(self, key) 467 def __getitem__(self, key): 468 if isinstance(key, basestring): --> 469 return self._getitem_coord(key) 470 else: 471 # orthogonal array indexing ~/.pyvirtualenvs/py3/lib/python3.5/site-packages/xarray/core/dataarray.py in _getitem_coord(self, key) 461 dim_sizes = dict(zip(self.dims, self.shape)) 462 _, key, var = _get_virtual_variable( --> 463 self._coords, key, self._level_coords, dim_sizes) 464 465 return self._replace_maybe_drop_dims(var, name=key) ~/.pyvirtualenvs/py3/lib/python3.5/site-packages/xarray/core/dataset.py in _get_virtual_variable(variables, key, level_vars, dim_sizes) 82 data = getattr(ref_var.dt, var_name).data 83 else: ---> 84 data = getattr(ref_var, var_name).data 85 virtual_var = Variable(ref_var.dims, data) 86 AttributeError: 'IndexVariable' object has no attribute 'month' ```","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/1565/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 184456540,MDU6SXNzdWUxODQ0NTY1NDA=,1056,groupby_bins along two dims simultaneously,10050469,open,0,,,3,2016-10-21T10:50:06Z,2020-10-04T05:06:37Z,,MEMBER,,,,"I probably missed it, but what is the way to apply groupby (or rather groupby_bins) in order to achieve the following in xarray? ``` python da = xr.DataArray(np.arange(16).reshape((4, 4))) da array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) Coordinates: * dim_0 (dim_0) int64 0 1 2 3 * dim_1 (dim_1) int64 0 1 2 3 # should be aggregated to (in case of summing) to obtain dagg array([[10, 18], [42, 50]]) Coordinates: * dim_1 (dim_1) int64 0 2 * dim_0 (dim_0) int64 0 2 ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/1056/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue