issue_comments
5 rows where issue = 192325490 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- timedelta64[D] is always coerced to timedelta64[ns] · 5 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
417381010 | https://github.com/pydata/xarray/issues/1143#issuecomment-417381010 | https://api.github.com/repos/pydata/xarray/issues/1143 | MDEyOklzc3VlQ29tbWVudDQxNzM4MTAxMA== | shoyer 1217238 | 2018-08-30T16:26:20Z | 2018-08-30T16:26:20Z | MEMBER |
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
timedelta64[D] is always coerced to timedelta64[ns] 192325490 | |
417337306 | https://github.com/pydata/xarray/issues/1143#issuecomment-417337306 | https://api.github.com/repos/pydata/xarray/issues/1143 | MDEyOklzc3VlQ29tbWVudDQxNzMzNzMwNg== | DavidTsangHW 12130884 | 2018-08-30T14:21:55Z | 2018-08-30T14:21:55Z | NONE | Pardon me for extending this discussion. I encountered the same problem when calculating timedelta in a dataframe. It even ended with an error when I tried to call the days attribute. I am using Numpy 1.6.1 AttributeError: 'Series' object has no attribute 'days' Problem df_trans['DELTA'] = df_trans['DATE2'] - df_trans['DATE1'] print df_trans['DELTA'].dtype
print df_trans['DELTA']
df_trans['DELTA'] = df_trans['DELTA'].astype('timedelta64[D]') print df_trans['DELTA'].dtype
print df_trans['DELTA']
print df_trans['DELTA'].days
I get rid of the problem by putting it in to a list for the conversion.
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
timedelta64[D] is always coerced to timedelta64[ns] 192325490 | |
264133419 | https://github.com/pydata/xarray/issues/1143#issuecomment-264133419 | https://api.github.com/repos/pydata/xarray/issues/1143 | MDEyOklzc3VlQ29tbWVudDI2NDEzMzQxOQ== | hottwaj 5629061 | 2016-12-01T10:15:21Z | 2016-12-01T10:15:21Z | NONE | The pandas docs do seem to say that conversion to timedelta64[D] (or other frequencies) is possible - see: http://pandas.pydata.org/pandas-docs/stable/timedeltas.html#frequency-conversion Also here's a more realistic example of why this is problematic for me - I have a sequence of dates and I want to calculate the difference between them in days: possible in pandas, but not possible in xarray without first reverting to pandas/numpy types ``` dates = pandas.Series([datetime.date(2016, 01, 10), datetime.date(2016, 01, 20), datetime.date(2016, 01, 25)]).astype('datetime64[ns]') dates.diff().astype('timedelta64[D]').astype(float) returns0 NaN1 10.02 5.0dtype: float6xarray.DataArray(dates).diff(dim = 'dim_0').astype('timedelta64[D]').astype(float) returns<xarray.DataArray (dim_0: 2)>array([ 8.64000000e+14, 4.32000000e+14])Coordinates:* dim_0 (dim_0) int64 1 2``` Again the xarray result is in ns rather than days. Thanks |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
timedelta64[D] is always coerced to timedelta64[ns] 192325490 | |
263642220 | https://github.com/pydata/xarray/issues/1143#issuecomment-263642220 | https://api.github.com/repos/pydata/xarray/issues/1143 | MDEyOklzc3VlQ29tbWVudDI2MzY0MjIyMA== | shoyer 1217238 | 2016-11-29T17:40:49Z | 2016-11-29T17:40:49Z | MEMBER | Interesting. Pandas always uses nanosecond precision for In [14]: s Out[14]: 0 1 days 1 2 days 2 3 days 3 4 days dtype: timedelta64[D] In [16]: pandas.Index(s) Out[16]: TimedeltaIndex(['1 days', '2 days', '3 days', '4 days'], dtype='timedelta64[ns]', freq=None) ``` This might actually be a pandas bug -- as far as I recall, this goes against the documented behavior. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
timedelta64[D] is always coerced to timedelta64[ns] 192325490 | |
263626446 | https://github.com/pydata/xarray/issues/1143#issuecomment-263626446 | https://api.github.com/repos/pydata/xarray/issues/1143 | MDEyOklzc3VlQ29tbWVudDI2MzYyNjQ0Ng== | hottwaj 5629061 | 2016-11-29T16:47:25Z | 2016-11-29T16:47:25Z | NONE | The conversion to timedelta64[ns] is done on this line of code: https://github.com/pydata/xarray/blob/d66f673ab25fe0fc0483bd5d67479fc94a14e46d/xarray/core/variable.py#L169 Is there a reason behind the conversion, or could it be removed? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
timedelta64[D] is always coerced to timedelta64[ns] 192325490 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 3