home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 160466764

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
160466764 MDU6SXNzdWUxNjA0NjY3NjQ= 883 ENH: Allow ds selection with callable? 5635139 closed 0     3 2016-06-15T16:31:35Z 2016-08-02T17:51:43Z 2016-08-02T17:51:43Z MEMBER      

Inspired by: https://github.com/pydata/xarray/pull/844. This is a more general case for variable selection.

We could allow a selection of variables with a callable, similar (but not the same) as pandas' implementation:

``` python In [5]: ds=xr.Dataset({'a': (('x', 'y'), np.random.rand(10,2))}) Out[4]: <xarray.Dataset> Dimensions: (x: 10, y: 2) Coordinates: * x (x) int64 0 1 2 3 4 5 6 7 8 9 * y (y) int64 0 1 Data variables: a (x, y) float64 0.5819 0.1214 0.2645 0.9053 0.6968 0.1608 0.3199 ...

In [9]: ds['a'].attrs['clean'] = True

potentially:

In [10]: ds[lambda x: x.attrs['clean']]

... would return ds['a']

```

This would mean functions wouldn't be able to be dataset keys - I don't think that's a big issue, but could arise with callable classes, for example.

Another option would be a .filter / .select method or indexer.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/883/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 69.141ms · About: xarray-datasette