home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 201302454

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/802#issuecomment-201302454 https://api.github.com/repos/pydata/xarray/issues/802 201302454 MDEyOklzc3VlQ29tbWVudDIwMTMwMjQ1NA== 4160723 2016-03-25T14:17:29Z 2016-03-25T14:17:29Z MEMBER

I followed your suggestions.

Two more comments (not critical issues I think) : - Multi-index level drop only works when a dict is provided for a dimension, i.e., da.sel(band_wavenumber='foo') still returns the full pandas.MultiIndex. This would require for indexing.convert_label_indexer to return an updated index also when label is not dict-like, which is not that straightforward I think. - There is a potential conflict when providing a dictionary to DataArray.loc, it may be interpreted either as a mapping of dimensions / labels or a mapping of index levels / labels for the 1st dimension. For now, the second option is not handled, e.g., da.loc[{'band': 'foo'}] raises a KeyError.

In summary, da.loc[{'band_wavenumber': {'band': 'foo'}}] returns a DataArray with updated index and coordinate / dimension name, da.loc['foo'] returns a DataArray with the full multi-index, and da.loc[{'band': 'foo'}] raises a KeyError. Three different results for the same operation, although I think that the first one is more explicit and better.

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