home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 302358284

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/pull/1412#issuecomment-302358284 https://api.github.com/repos/pydata/xarray/issues/1412 302358284 MDEyOklzc3VlQ29tbWVudDMwMjM1ODI4NA== 4160723 2017-05-18T09:56:28Z 2017-05-18T09:58:06Z MEMBER

A possible direction to reduce the if statements in many different places would be to just return pos_indexers in indexing.remap_level_indexers - as it was the case before adding multi-index support - and instead put in Dataset.isel all the logic for checking MultiIndex and maybe convert it to Index and/or scalar coordinates and maybe rename dimension.

This would simplify many things, although I haven't thought about about all other possible issues it would create (perfomance, etc.). Also, DataArray.loc doesn't seem to use Dataset.isel.

Here is another case related to this PR. From the example in the linked issue, the current behavior is

python In [9]: ds.isel(yx=[0, 1]) Out[9]: <xarray.Dataset> Dimensions: (yx: 2) Coordinates: * yx (yx) MultiIndex - y (yx) object 'a' 'a' - x (yx) int64 1 2 Data variables: foo (yx) int64 1 2

Do we want to also change the behavior to this?

python In [10]: ds.isel(yx=[0, 1]) Out[10]: <xarray.Dataset> Dimensions: (x: 2) Coordinates: * x (x) int64 1 2 y object 'a' Data variables: foo (x) int64 1 2

To me it looks like it is a bit too magical, but just wondering what you think...

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