home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 217485308 and user = 10050469 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

  • fmaussion · 3 ✖

issue 1

  • time dimension · 3 ✖

author_association 1

  • MEMBER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
289715756 https://github.com/pydata/xarray/issues/1334#issuecomment-289715756 https://api.github.com/repos/pydata/xarray/issues/1334 MDEyOklzc3VlQ29tbWVudDI4OTcxNTc1Ng== fmaussion 10050469 2017-03-28T09:33:30Z 2017-03-28T09:33:30Z MEMBER

What I want is to access the array [0,1,2,3....] as integers

ds['time.hour'].values gives you access to the underlying numpy arrays. However, it is needed only in rare case since xarray data structures behave like numpy arrays (one reason why you would want to access the numpy arrays instead of xarrays DataArrays is for performance).

Perhaps xr is it something more to plot data, and the objects within xr are only capable of manipulation only within a limited framework.

I strongly disagree with that one of course ;-) Let us now if we can do anything about the documentation in order to improve it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  time dimension 217485308
289708753 https://github.com/pydata/xarray/issues/1334#issuecomment-289708753 https://api.github.com/repos/pydata/xarray/issues/1334 MDEyOklzc3VlQ29tbWVudDI4OTcwODc1Mw== fmaussion 10050469 2017-03-28T09:05:21Z 2017-03-28T09:05:21Z MEMBER

I don't really understand what you mean. Here is the example from the docs again:

python import xarray as xr import pandas as pd import numpy as np time = pd.date_range('2000-01-01', freq='H', periods=24) ds = xr.Dataset({'foo': ('time', np.arange(24)), 'time': time}) ds['time.hour']

which prints:

<xarray.DataArray 'hour' (time: 24)> array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], dtype=int32) Coordinates: * time (time) datetime64[ns] 2000-01-01 2000-01-01T01:00:00 ...

What is it exactly what you are expecting?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  time dimension 217485308
289704003 https://github.com/pydata/xarray/issues/1334#issuecomment-289704003 https://api.github.com/repos/pydata/xarray/issues/1334 MDEyOklzc3VlQ29tbWVudDI4OTcwNDAwMw== fmaussion 10050469 2017-03-28T08:46:14Z 2017-03-28T08:46:14Z MEMBER

Yes, many new users of xarray are confused by this one: ds['time.hour'] is probably what you want. It is documented here:

http://xarray.pydata.org/en/latest/time-series.html#datetime-components

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  time dimension 217485308

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