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/3609#issuecomment-564707090,https://api.github.com/repos/pydata/xarray/issues/3609,564707090,MDEyOklzc3VlQ29tbWVudDU2NDcwNzA5MA==,13301940,2019-12-11T19:57:11Z,2019-12-11T19:57:11Z,MEMBER,"@dcherian, Thank you for chiming in! Are there any other issues with discussions about implementation for `Timedelta` functionality? I am happy to take a stab at implementing this. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,535812301
https://github.com/pydata/xarray/issues/3609#issuecomment-564704057,https://api.github.com/repos/pydata/xarray/issues/3609,564704057,MDEyOklzc3VlQ29tbWVudDU2NDcwNDA1Nw==,13301940,2019-12-11T19:49:18Z,2019-12-11T19:51:12Z,MEMBER,"1) Per [Pandas documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Timedelta.html), the following are the defined attributes for `Timedelta`:
asm8 | Return a numpy timedelta64 array scalar view.
-- | --
components | Return a components namedtuple-like.
days | Number of days.
delta | Return the timedelta in nanoseconds (ns), for internal compatibility.
microseconds | Number of microseconds (>= 0 and less than 1 second).
nanoseconds | Return the number of nanoseconds (n), where 0 <= n < 1 microsecond.
resolution | Return a string representing the lowest timedelta resolution.
resolution_string | Return a string representing the lowest timedelta resolution.
seconds | Number of seconds (>= 0 and less than 1 day).
and since xarray coerces the dataarray to a Pandas Series prior accessing the requested attribute, calling `start_t.dt.second` fails.
2) Since `seconds` is a defined attribute for `pandas.TimeDelta`, I expect `start_t.dt.seconds` to work. However, it fails:
```python
In [33]: start_t.dt.seconds
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
----> 1 start_t.dt.seconds
AttributeError: 'DatetimeAccessor' object has no attribute 'seconds'
```
**This is likely a bug in xarray.**
3) Pandas appears to be establishing differences between `DatetimeProperties` and `TimedeltaProperties`:
```python
In [16]: start_t_series.dt
Out[16]:
In [17]: dt_array_series.dt
Out[17]:
```
Xarray, on the other hand, seems to be treating them the same:
```python
In [18]: dt_array.dt
Out[18]:
In [19]: start_t.dt
Out[19]:
```
- Should xarray establish differences between `DatetimeProperties` and `TimedeltaProperties`??
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,535812301