home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 217347106 and user = 1217238 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

  • shoyer · 2 ✖

issue 1

  • Convert an existing xarray dimension into a MultiIndex · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
289856794 https://github.com/pydata/xarray/issues/1331#issuecomment-289856794 https://api.github.com/repos/pydata/xarray/issues/1331 MDEyOklzc3VlQ29tbWVudDI4OTg1Njc5NA== shoyer 1217238 2017-03-28T18:11:02Z 2017-03-28T18:11:02Z MEMBER

Given your two Datasets and your desired result, why not simply using concat?

OK, I feel pretty dumb now. Yes, that's totally the right way to do this. For some reason I was fixated on converting each dataset individually to have a MultiIndex before combining them.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Convert an existing xarray dimension into a MultiIndex 217347106
289559117 https://github.com/pydata/xarray/issues/1331#issuecomment-289559117 https://api.github.com/repos/pydata/xarray/issues/1331 MDEyOklzc3VlQ29tbWVudDI4OTU1OTExNw== shoyer 1217238 2017-03-27T19:27:27Z 2017-03-27T19:27:27Z MEMBER

Currently the best I have is: python (ds1.reset_index('x') .rename({'x': 'yx', 'x_': 'x'}) .assign_coords(y=lambda ds: (('yx',), [ds.y.item()] * 3)) .set_index(yx=['y', 'x'])) <xarray.Dataset> Dimensions: (yx: 3) Coordinates: * yx (yx) MultiIndex - y (yx) object 'a' 'a' 'a' - x (yx) int64 1 2 3 Data variables: foo (yx) int64 1 2 3 which is rather un-intuitive.

It occurs to me that maybe this is just a good use case for expand_dims (#1326), which could make this as simple as ds1.expand_dims('y').stack(yx=['y', 'x']))

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Convert an existing xarray dimension into a MultiIndex 217347106

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