home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 484970078

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/2907#issuecomment-484970078 https://api.github.com/repos/pydata/xarray/issues/2907 484970078 MDEyOklzc3VlQ29tbWVudDQ4NDk3MDA3OA== 2448579 2019-04-19T17:51:44Z 2019-04-19T17:51:44Z MEMBER

automatic broadcasting is an extremely useful feature of xarray: See https://xarray.pydata.org/en/stable/computation.html#broadcasting-by-dimension-name for examples.

What I didn't know was that the dimensions to multiply have to have the same names.

If the dimensions don't have the same name; xarray "broadcasts" both variables so that they each have both dimensions and then does the arithmetic operation you ask it to.

I thought I could sum over different coordinates indicating the names within the dims keyword, but the implementation makes totally sense now. To summarize:

This is correct but you're misunderstanding the applicability here (I think).

But shouldn't there be an error message if one specifies dimensions to dims that are not in both of the dataarrays?

No, broadcasting is a feature.

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