home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 302693433

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-302693433 https://api.github.com/repos/pydata/xarray/issues/1412 302693433 MDEyOklzc3VlQ29tbWVudDMwMjY5MzQzMw== 6815844 2017-05-19T12:47:28Z 2017-05-19T12:47:28Z MEMBER

I also agree. It seems too magical.

But I slightly changed my mind. I notice what I really want to have is not particular scalar coordinate in MultiIndex, but 'unified' interface between normal Vraiable and MultiIndex.

The current structure is illustrated as follows,

The MultiIndex has different characteristics from normal Variable. For example, if we do ds.sel(x=2), it makes a scalar coordinate and normal Variable. The backward process might be .expand_dims().stack(). This is different from normal Variable behavior. And because of it, MultiIndex should be treated in special way in every place. (Deprecating the automatic-renaming does not change things so much.)

I am wondering if we could have the following class structure things become simpler

In this picture, MultiIndex can have scalar as its level and .isel() produces it. This process can be traced backward by .expand_dims() or .concat() as in normal Variable.

I understand it is different from pandas.MultiIndex structure, and we need to expand our wrapper extensively if we decide to realize it (as written in red). But I feel this symmetric structure could make it easy to expand MultiIndex functionalities in future.

Any thoughts are welcome. (Should move discussion to another issue?)

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