home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where author_association = "MEMBER" and issue = 279595497 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • shoyer 3
  • dcherian 2

issue 1

  • ENH: Add dt.date accessor. · 5 ✖

author_association 1

  • MEMBER · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
349819742 https://github.com/pydata/xarray/pull/1762#issuecomment-349819742 https://api.github.com/repos/pydata/xarray/issues/1762 MDEyOklzc3VlQ29tbWVudDM0OTgxOTc0Mg== shoyer 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
}
  ENH: Add dt.date accessor. 279595497
349559801 https://github.com/pydata/xarray/pull/1762#issuecomment-349559801 https://api.github.com/repos/pydata/xarray/issues/1762 MDEyOklzc3VlQ29tbWVudDM0OTU1OTgwMQ== dcherian 2448579 2017-12-06T07:39:53Z 2017-12-06T07:39:53Z MEMBER

Oh, I see your point. Once implemented, would the round/ceil/floor methods work as arguments to groupby too? That's really what I wanted to do.

Are you in favor of renaming the current functionality todt.yeardate or some such for convenient usage? I expect it would be a common use case

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Add dt.date accessor. 279595497
349548370 https://github.com/pydata/xarray/pull/1762#issuecomment-349548370 https://api.github.com/repos/pydata/xarray/issues/1762 MDEyOklzc3VlQ29tbWVudDM0OTU0ODM3MA== shoyer 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
}
  ENH: Add dt.date accessor. 279595497
349509477 https://github.com/pydata/xarray/pull/1762#issuecomment-349509477 https://api.github.com/repos/pydata/xarray/issues/1762 MDEyOklzc3VlQ29tbWVudDM0OTUwOTQ3Nw== dcherian 2448579 2017-12-06T02:21:46Z 2017-12-06T02:21:46Z MEMBER

@shoyer Didn't know .floor() was an option. I've used your suggestion now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Add dt.date accessor. 279595497
349508097 https://github.com/pydata/xarray/pull/1762#issuecomment-349508097 https://api.github.com/repos/pydata/xarray/issues/1762 MDEyOklzc3VlQ29tbWVudDM0OTUwODA5Nw== shoyer 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
}
  ENH: Add dt.date accessor. 279595497

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 13.294ms · About: xarray-datasette