home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 586123705

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/3768#issuecomment-586123705 https://api.github.com/repos/pydata/xarray/issues/3768 586123705 MDEyOklzc3VlQ29tbWVudDU4NjEyMzcwNQ== 1217238 2020-02-14T06:52:27Z 2020-02-14T06:52:27Z MEMBER

The model of how indexing with non-DataArray objects is described here under vectorized indexing: “Slices or sequences/arrays without named-dimensions are treated as if they have the same dimension which is indexed along”

For better or worse, xarray doesn’t have any way to distinguish between “meaningful” and “default” dimension names. This means that a DataArray without explicitly named dimensions will indeed broadcast differently (e.g., in either arithmetic or indexing) than unlabeled NumPy arrays.

These were intentional design choices: we like our name based broadcasting rules better than NumPy’s positional rules. And for the most part, the default dimension names like dim_0 are just there so a user can see how they need to change their data instead of getting an error message.

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