home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 907901984

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/5733#issuecomment-907901984 https://api.github.com/repos/pydata/xarray/issues/5733 907901984 IC_kwDOAMm_X842HXwg 2448579 2021-08-29T23:50:59Z 2021-08-29T23:50:59Z MEMBER

I have a related question

``` python import xarray as xr

da = xr.DataArray([[1, 1, 1], [2, 2, 2]], dims=("x", "y"))

xr.testing.assert_identical(da, da.transpose()) AssertionError: Left and right DataArray objects are not identical Differing dimensions: (x: 2, y: 3) != (y: 3, x: 2) Differing values: L array([[1, 1, 1], [2, 2, 2]]) R array([[1, 2], [1, 2], [1, 2]]) ```

Strictly speaking, the values are different I guess. However I think this error would be clearer if it said that the dimension order was different but the values are equal once the dimensions are transposed.

I.e. we could

python if set(a.dims) == set(b.dims): a = a.transpose(b.dims) # check values and raise if actually different else: # current behaviour

Is this a good idea?

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