home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 400678252 and user = 9658781 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

  • jendrikjoe · 2 ✖

issue 1

  • [Feature Request] Dataset.loc should accept comparisons with a contained DataArray as key · 2 ✖

author_association 1

  • CONTRIBUTOR 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
456201092 https://github.com/pydata/xarray/issues/2689#issuecomment-456201092 https://api.github.com/repos/pydata/xarray/issues/2689 MDEyOklzc3VlQ29tbWVudDQ1NjIwMTA5Mg== jendrikjoe 9658781 2019-01-21T21:17:02Z 2019-01-21T21:17:02Z CONTRIBUTOR

Okay will have a look at #1887 first, before going forward with this request :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [Feature Request] Dataset.loc should accept comparisons with a contained DataArray as key 400678252
456128567 https://github.com/pydata/xarray/issues/2689#issuecomment-456128567 https://api.github.com/repos/pydata/xarray/issues/2689 MDEyOklzc3VlQ29tbWVudDQ1NjEyODU2Nw== jendrikjoe 9658781 2019-01-21T16:21:29Z 2019-01-21T16:21:29Z CONTRIBUTOR

Hey Shoyer,

sure I am happy to propose one. Given the input from the xarray example page (http://xarray.pydata.org/en/stable/examples/weather-data.html), I would imagine something like this:

python xarr = xarr.loc[xarr['tmin'] > 5]

If the DataArray is one dimensional this is straight forward to achieve by altering the _LocIndexer in the following way: ``` class _LocIndexer(object): def init(self, dataset): self.dataset = dataset

def __getitem__(self, key):
    if not utils.is_dict_like(key):
        selector = {dim: key[dim][key] for dim in key.dims}
        keep_vars = []
        for var in self.dataset.data_vars:
            if np.all(dim in self.dataset[var].dims for dim in key.dims):
                keep_vars.append(var)
        return self.dataset[keep_vars].sel(selector)
    return self.dataset.sel(**key)

```

This does not work for higher dimensions though as 2-dimensional boolean indexing is not supported. It would as well get rid of all other DataArrarys which do not have shared dimensions with the indexer. Probably, there is a better place to do this, that in the loc function. However, I think it would be great in case people need to filter their data by something else than the array dimensions.

Cheers,

Jendrik

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [Feature Request] Dataset.loc should accept comparisons with a contained DataArray as key 400678252

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