home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 377314912

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2027#issuecomment-377314912 https://api.github.com/repos/pydata/xarray/issues/2027 377314912 MDEyOklzc3VlQ29tbWVudDM3NzMxNDkxMg== 1217238 2018-03-29T17:40:30Z 2018-03-29T17:40:30Z MEMBER

I think the short answer why we don't support this is that with __getitem__ on Dataset it's potentially ambiguous which dimensions you are slicing along. This is why we require you to specify the dimensions using sel().

This might be clearer with integer indexing. We support indexing like ds.vote[np.array([1, 2])] or ds.vote[xarray.DataArray([1, 2], dims='new_dim')] because it's clear what the first dimension of ds.vote is. (Recall that the dimensions of the indexing key only determine how data in the result is arranged, not what is indexed.) But we don't support ds[np.array([1, 2])], because axis-order dependent indexing on a Dataset is potentially ambiguous.

However, we could potentially support this as a form of "multi-dimensional boolean indexing" (https://github.com/pydata/xarray/issues/1887). Basically, ds[key] where key is a single indexer with boolean dtype could be interpreted as equivalent to ds.where(key, drop=True).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  309686915
Powered by Datasette · Queries took 0.817ms · About: xarray-datasette