home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "MEMBER" and issue = 524940277 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • fujiisoup 1
  • mathause 1

issue 1

  • loc API gives KeyError: "not all values found in index" · 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
555537348 https://github.com/pydata/xarray/issues/3546#issuecomment-555537348 https://api.github.com/repos/pydata/xarray/issues/3546 MDEyOklzc3VlQ29tbWVudDU1NTUzNzM0OA== fujiisoup 6815844 2019-11-19T14:40:01Z 2019-11-19T14:40:01Z MEMBER

This behaviour, however, seems to be slightly different from the .loc API of pandas.DataFrame which can take boolean arrays for selection. Is there a reason for the discrepancy?

Hi, @roxyboy

This is just because that multidimensional boolean indexing is not yet implemented in xarray (#1887). The one-dimensional indexing would work with .loc, ```python In [2]: da = xr.DataArray([0, 1, 2], dims=['x'])

In [3]: da.loc[da < 1]
Out[3]: <xarray.DataArray (x: 1)> array([0]) Dimensions without coordinates: x ```

FYI, in xarray, probably .sel and .isel methods are more convenient than .loc, as we don't need to remember the dimension order. For the above (my) example, I would write python da.isel(x=da < 1) instead of da.loc[da < 1].

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  loc API gives KeyError: "not all values found in index" 524940277
555526229 https://github.com/pydata/xarray/issues/3546#issuecomment-555526229 https://api.github.com/repos/pydata/xarray/issues/3546 MDEyOklzc3VlQ29tbWVudDU1NTUyNjIyOQ== mathause 10194086 2019-11-19T14:15:36Z 2019-11-19T14:15:36Z MEMBER

I think .loc does not take a boolean array for selection but the actual lon values you want to select. To select with a boolean array you would do:

python sel = da[0, 0] < mask da[0, 0][sel] If you want to use .loc you first need to get the longitude values to select by:

``` python sel_lon = da[0, 0].lon[sel] da[0, 0].loc[sel_lon]

```

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  loc API gives KeyError: "not all values found in index" 524940277

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