issues: 589632313
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
589632313 | MDU6SXNzdWU1ODk2MzIzMTM= | 3910 | In-place addition of arrays with the same coords but in a different order | 31126826 | closed | 0 | 7 | 2020-03-28T18:27:58Z | 2020-06-24T14:41:06Z | 2020-06-24T14:41:06Z | CONTRIBUTOR | I have two DataArrays with the same dimension, but the index is in a different order.
Adding them with MCVE Code Sample```python import numpy as np import xarray as xr n = 5 d1 = np.arange(n) np.random.shuffle(d1) A = xr.DataArray(np.ones(n), coords=[('dim', d1)]) d2 = np.arange(n) np.random.shuffle(d2) B = xr.DataArray(np.ones(n), coords=[('dim', d2)]) print(A + B) A += B ``` Expected Output
Problem DescriptionThe in-place addition VersionsOutput of `xr.show_versions()`INSTALLED VERSIONS ------------------ commit: None python: 3.8.2 (default, Mar 26 2020, 15:53:00) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.19.112-1-MANJARO machine: x86_64 processor: byteorder: little LC_ALL: None LANG: fr_FR.UTF-8 LOCALE: fr_FR.UTF-8 libhdf5: None libnetcdf: None xarray: 0.15.0 pandas: 1.0.3 numpy: 1.18.1 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None setuptools: 46.1.1.post20200323 pip: 20.0.2 conda: None pytest: None IPython: None sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3910/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |