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/pull/1762#issuecomment-349819742,https://api.github.com/repos/pydata/xarray/issues/1762,349819742,MDEyOklzc3VlQ29tbWVudDM0OTgxOTc0Mg==,1217238,2017-12-07T00:23:27Z,2017-12-07T00:23:27Z,MEMBER,"> Once implemented, would the round/ceil/floor methods work as arguments to groupby too?
Sure. You could write, e.g., `ds.groupby(ds.time.dt.floor('1D')).mean()`
> Are you in favor of renaming the current functionality todt.yeardate or some such for convenient usage?
I would be inclined to stick to the datetime methods/properties from pandas: https://pandas.pydata.org/pandas-docs/stable/api.html#datetimelike-properties","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,279595497
https://github.com/pydata/xarray/pull/1762#issuecomment-349548370,https://api.github.com/repos/pydata/xarray/issues/1762,349548370,MDEyOklzc3VlQ29tbWVudDM0OTU0ODM3MA==,1217238,2017-12-06T06:30:54Z,2017-12-06T06:30:54Z,MEMBER,"@dcherian I think I was unclear in my earlier comment. I don't like the current API, because it is inconsistent with `pandas.Series.dt.date` which returns an Series of `datetime.date` objects with `dtype=object`. Instead, why not implement methods `xarray.DataArray.dt.floor()`, `xarray.DataArray.dt.ceil()` and `xarray.DataArray.dt.round()`, like the pandas methods of the same name?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,279595497
https://github.com/pydata/xarray/pull/1762#issuecomment-349508097,https://api.github.com/repos/pydata/xarray/issues/1762,349508097,MDEyOklzc3VlQ29tbWVudDM0OTUwODA5Nw==,1217238,2017-12-06T02:14:18Z,2017-12-06T02:14:18Z,MEMBER,"My main concern here is that pandas returns an array of `datetime.date` objects when you access `.date`. I think that's why we left it off in original implementation here:
```
In [1]: import pandas as pd
In [2]: t = pd.date_range('2010-01-01', periods=12, freq='3H')
In [3]: t
Out[3]:
DatetimeIndex(['2010-01-01 00:00:00', '2010-01-01 03:00:00',
'2010-01-01 06:00:00', '2010-01-01 09:00:00',
'2010-01-01 12:00:00', '2010-01-01 15:00:00',
'2010-01-01 18:00:00', '2010-01-01 21:00:00',
'2010-01-02 00:00:00', '2010-01-02 03:00:00',
'2010-01-02 06:00:00', '2010-01-02 09:00:00'],
dtype='datetime64[ns]', freq='3H')
In [4]: t.date
Out[4]:
array([datetime.date(2010, 1, 1), datetime.date(2010, 1, 1),
datetime.date(2010, 1, 1), datetime.date(2010, 1, 1),
datetime.date(2010, 1, 1), datetime.date(2010, 1, 1),
datetime.date(2010, 1, 1), datetime.date(2010, 1, 1),
datetime.date(2010, 1, 2), datetime.date(2010, 1, 2),
datetime.date(2010, 1, 2), datetime.date(2010, 1, 2)], dtype=object)
```
Possibly implementing `.dt.floor()`, `.dt.ceil()` and `.dt.round()` (like pandas) would be a better way to do this? You would write something like `da.time.dt.floor('1D')` for this use-case.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,279595497