home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

1 row where issue = 334778045 and user = 6628425 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

  • spencerkclark · 1 ✖

issue 1

  • Implement shift for CFTimeIndex · 1 ✖

author_association 1

  • MEMBER 1
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
399406545 https://github.com/pydata/xarray/issues/2244#issuecomment-399406545 https://api.github.com/repos/pydata/xarray/issues/2244 MDEyOklzc3VlQ29tbWVudDM5OTQwNjU0NQ== spencerkclark 6628425 2018-06-22T11:05:18Z 2018-06-22T11:05:18Z MEMBER

@aidanheerdegen thanks, I agree an implementation of shift would be nice. In the meantime, if the offset can be written as a fixed amount of time (like 365 days as opposed to something like one month), a slightly simpler way than looping over the elements of the index is to add a datetime.timedelta object to it, e.g.:

``` In [1]: import numpy as np

In [2]: import xarray as xr

In [3]: from cftime import num2date

In [4]: from datetime import timedelta

In [5]: xr.set_options(enable_cftimeindex=True) Out[5]: <xarray.core.options.set_options at 0x110885a10>

In [6]: times = num2date(np.arange(730), calendar='noleap', units='days since 0001-01-01')

In [7]: da = xr.DataArray(np.arange(730), coords=[times], dims=['time'])

In [8]: da.time.get_index('time') Out[8]: CFTimeIndex([0001-01-01 00:00:00, 0001-01-02 00:00:00, 0001-01-03 00:00:00, 0001-01-04 00:00:00, 0001-01-05 00:00:00, 0001-01-06 00:00:00, 0001-01-07 00:00:00, 0001-01-08 00:00:00, 0001-01-09 00:00:00, 0001-01-10 00:00:00, ... 0002-12-22 00:00:00, 0002-12-23 00:00:00, 0002-12-24 00:00:00, 0002-12-25 00:00:00, 0002-12-26 00:00:00, 0002-12-27 00:00:00, 0002-12-28 00:00:00, 0002-12-29 00:00:00, 0002-12-30 00:00:00, 0002-12-31 00:00:00], dtype='object', name=u'time', length=730)

In [9]: da.time.get_index('time') + timedelta(days=365) Out[9]: Index([0002-01-01 00:00:00, 0002-01-02 00:00:00, 0002-01-03 00:00:00, 0002-01-04 00:00:00, 0002-01-05 00:00:00, 0002-01-06 00:00:00, 0002-01-07 00:00:00, 0002-01-08 00:00:00, 0002-01-09 00:00:00, 0002-01-10 00:00:00, ... 0003-12-22 00:00:00, 0003-12-23 00:00:00, 0003-12-24 00:00:00, 0003-12-25 00:00:00, 0003-12-26 00:00:00, 0003-12-27 00:00:00, 0003-12-28 00:00:00, 0003-12-29 00:00:00, 0003-12-30 00:00:00, 0003-12-31 00:00:00], dtype='object', length=730) Note, however, that currently the index type is not preserved under this sort of arithmetic (which we might consider a separate issue). This can be alleviated by casting the result as a `CFTimeIndex`: In [10]: xr.CFTimeIndex(da.time.get_index('time') + timedelta(days=365)) Out[10]: CFTimeIndex([0002-01-01 00:00:00, 0002-01-02 00:00:00, 0002-01-03 00:00:00, 0002-01-04 00:00:00, 0002-01-05 00:00:00, 0002-01-06 00:00:00, 0002-01-07 00:00:00, 0002-01-08 00:00:00, 0002-01-09 00:00:00, 0002-01-10 00:00:00, ... 0003-12-22 00:00:00, 0003-12-23 00:00:00, 0003-12-24 00:00:00, 0003-12-25 00:00:00, 0003-12-26 00:00:00, 0003-12-27 00:00:00, 0003-12-28 00:00:00, 0003-12-29 00:00:00, 0003-12-30 00:00:00, 0003-12-31 00:00:00], dtype='object', length=730) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement shift for CFTimeIndex  334778045

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