home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1396749591

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/7456#issuecomment-1396749591 https://api.github.com/repos/pydata/xarray/issues/7456 1396749591 IC_kwDOAMm_X85TQLUX 5821660 2023-01-19T10:26:56Z 2023-01-19T10:26:56Z MEMBER

@cmdupuis3 dimensions are not given in a particular order in the Dataset. There could be two DataArray's which have reversed dimensions for instance.

You would need to inspect the DataArray's:

python da = xr.DataArray([[1,2,3],[4,5,6],[7,8,9]], coords={'a':[1,2,3], 'b':[1,2,3]}) ds = xr.Dataset({'da':da}) ds0 = ds.expand_dims('yomama', axis=0) print(ds0.dims) print(ds0.da.dims) ds1 = ds.expand_dims('yomama', axis=1) print(ds1.dims) print(ds1.da.dims) ds2 = ds.expand_dims('yomama', axis=2) print(ds2.dims) print(ds2.da.dims) python Frozen({'a': 3, 'b': 3, 'yomama': 1}) ('yomama', 'a', 'b') Frozen({'a': 3, 'b': 3, 'yomama': 1}) ('a', 'yomama', 'b') Frozen({'a': 3, 'b': 3, 'yomama': 1}) ('a', 'b', 'yomama')

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