home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 152478345

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
152478345 MDU6SXNzdWUxNTI0NzgzNDU= 840 Unintuitive broadcasting behavior 2328459 closed 0     2 2016-05-02T04:03:39Z 2019-01-28T01:02:28Z 2019-01-28T01:02:28Z NONE      

Using python 2.7.10, xarray 0.7.2

python arr = xarray.DataArray(numpy.empty((3,3)), coords={'a':['a1', 'a2', 'a3'], 'b':['b1', 'b2', 'b3']}, dims=['a', 'b']) arr.loc['a2':'a3'] = arr.loc['a1':'a2']*arr.loc['a1'] arr.loc['a2':'a3'] = arr.loc['a1']*arr.loc['a1':'a2']

First assignment statements succeeds, while the second one generates ValueError: could not broadcast input array from shape (3,2) into shape (2,3)

I'd expect the multiplication not to swap the order of dimensions. But if it does, the assignment should be able to swap it back.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/840/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 74.605ms · About: xarray-datasette