home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 822320976 and user = 2448579 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: updated_at (date)

user 1

  • dcherian · 3 ✖

issue 1

  • KeyError when selecting "nearest" data with given tolerance · 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
791145448 https://github.com/pydata/xarray/issues/4995#issuecomment-791145448 https://api.github.com/repos/pydata/xarray/issues/4995 MDEyOklzc3VlQ29tbWVudDc5MTE0NTQ0OA== dcherian 2448579 2021-03-05T04:32:29Z 2021-03-05T04:32:29Z MEMBER

Actually does reindex do what you want, the returned coordinate labels will be what you provide.

```

ds.reindex(lat=[5,15,40], method="nearest", tolerance=5, fill_value=-999) <xarray.DataArray (lat: 2)> array([1, 2, -999]) Coordinates: * lat (lat) int64 5 15 40 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  KeyError when selecting "nearest" data with given tolerance  822320976
791021835 https://github.com/pydata/xarray/issues/4995#issuecomment-791021835 https://api.github.com/repos/pydata/xarray/issues/4995 MDEyOklzc3VlQ29tbWVudDc5MTAyMTgzNQ== dcherian 2448579 2021-03-04T23:16:00Z 2021-03-04T23:16:00Z MEMBER

in using a fill_value is that the indexing has to modify the data ( insert e.g. -999) and also 'invent' a new coordinate point ( here 40).

This seems totally doable though.

One fill_value might not fit to all data arrays

In quite a few functions, fill_value can be a dict mapping variable name to a value so this is workable.

Let's see what others think.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  KeyError when selecting "nearest" data with given tolerance  822320976
790878651 https://github.com/pydata/xarray/issues/4995#issuecomment-790878651 https://api.github.com/repos/pydata/xarray/issues/4995 MDEyOklzc3VlQ29tbWVudDc5MDg3ODY1MQ== dcherian 2448579 2021-03-04T19:40:29Z 2021-03-04T19:40:29Z MEMBER

```

ds.sel(lat=[5,15,40], method="nearest", tolerance=5) <xarray.DataArray (lat: 2)> array([1, 2]) Coordinates: * lat (lat) int64 10 20 ```

This is a very surprising result, you've asked for values at three points but received two back.

The following (specifying fill_value) seems like better behaviour to me but how do you choose the coordinate label (here I picked 40 since that was provided to sel) ```

ds.sel(lat=[5,15,40], method="nearest", tolerance=5, fill_value=-999) <xarray.DataArray (lat: 2)> array([1, 2, -999]) Coordinates: * lat (lat) int64 10 20 40 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  KeyError when selecting "nearest" data with given tolerance  822320976

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