home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

1 row where issue = 181534708 and user = 900941 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • guziy · 1 ✖

issue 1

  • DataArray resample does not work if the time coordinate name is different from the corresponding dimension name. · 1 ✖

author_association 1

  • CONTRIBUTOR 1
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
252193599 https://github.com/pydata/xarray/issues/1041#issuecomment-252193599 https://api.github.com/repos/pydata/xarray/issues/1041 MDEyOklzc3VlQ29tbWVudDI1MjE5MzU5OQ== guziy 900941 2016-10-07T09:26:28Z 2016-10-07T09:26:59Z CONTRIBUTOR

Hi @shoyer:

Does a2.resample("D", "time") work in your second example?

with a2.resample("D", "time") I get the following exception:

ValueError: 'time' not found in array dimensions ('t',)

but I think this is working as intended -- if you only supply the name of a dimension with integer labels, xarray has no way to know how what times to use for resampling.

I am not sure how it is done now or whether it is possible to implement, but I feel like it searches for the coordinate with the same name as the supplied dimension. Probably searching for a coordinate containing only the dimension specified in resample could do the trick.

Maybe there is a better way to do what I am trying to do?: I needed it to calculate daily means. But I have a hole in my data in the middle of the year and resample is masking this hole, by adding masked fields. So I've done it with groupby as follows, but it seems there should be an easier way to achieve this:

python day_dates = [datetime(d.year, d.month, d.day) for d in pd.to_datetime(snfl.coords["t"].values)] day_dates = DataArray(day_dates, name="time", dims="t") snfl = snfl.groupby(day_dates).mean(dim="t")

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray resample does not work if the time coordinate name is different from the corresponding dimension name. 181534708

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 12.086ms · About: xarray-datasette