home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 392535505 and user = 6815844 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: updated_at (date)

user 1

  • fujiisoup · 4 ✖

issue 1

  • Fix multiindex selection · 4 ✖

author_association 1

  • MEMBER 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
448909559 https://github.com/pydata/xarray/pull/2621#issuecomment-448909559 https://api.github.com/repos/pydata/xarray/issues/2621 MDEyOklzc3VlQ29tbWVudDQ0ODkwOTU1OQ== fujiisoup 6815844 2018-12-20T08:09:09Z 2018-12-20T08:09:09Z MEMBER

I moved MultiIndex.remove_unused_levels() to the inside of unstack. Now it is invoked only when unstack is called.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix multiindex selection 392535505
448894775 https://github.com/pydata/xarray/pull/2621#issuecomment-448894775 https://api.github.com/repos/pydata/xarray/issues/2621 MDEyOklzc3VlQ29tbWVudDQ0ODg5NDc3NQ== fujiisoup 6815844 2018-12-20T06:59:43Z 2018-12-20T06:59:43Z MEMBER

But this problem of .sel can be simply solved by manually raising a keyerror if the result of get_loc is size 0 array.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix multiindex selection 392535505
448887168 https://github.com/pydata/xarray/pull/2621#issuecomment-448887168 https://api.github.com/repos/pydata/xarray/issues/2621 MDEyOklzc3VlQ29tbWVudDQ0ODg4NzE2OA== fujiisoup 6815844 2018-12-20T06:22:38Z 2018-12-20T06:22:38Z MEMBER

@shoyer

My inclination was just to copy what pandas does (which is only removing unused levels in unstack)

Thanks. I will take a look the source later.

Can you explain why matters for .sel()?

Selection of non-exsiting level variable should be KeyError, but it gives a 0-size index.

```python In [8]: ds = xr.DataArray(np.arange(40).reshape(8, 5), dims=['x', 'y'],
coords={'x': np.arange(8), 'y': np.arange(5)}).stack(xy=['x', 'y'])

In [9]: ds.isel(xy=ds['x'] < 4).sel(x=5) # should be KeyError Out[9]: <xarray.DataArray (y: 0)> array([], dtype=int64) Coordinates: * y (y) int64 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix multiindex selection 392535505
448752816 https://github.com/pydata/xarray/pull/2621#issuecomment-448752816 https://api.github.com/repos/pydata/xarray/issues/2621 MDEyOklzc3VlQ29tbWVudDQ0ODc1MjgxNg== fujiisoup 6815844 2018-12-19T21:38:18Z 2018-12-19T21:38:18Z MEMBER

@shoyer

This issue does not matter only in unstack but also in sel (reindex also?). We can do it in both methods for efficiency, but I just prefered to do it in one place for the quick fix.

But what is the good place to do it actually? If we invoke this in sel, it would be again inefficient as this is called every time we did .sel.

Probably the best for the efficiency is to keep a flag for it in PandasIndexAdapter and do it in _get_item_with_mask and get_loc only if flag is raised?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix multiindex selection 392535505

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