home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 532777471

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/3315#issuecomment-532777471 https://api.github.com/repos/pydata/xarray/issues/3315 532777471 MDEyOklzc3VlQ29tbWVudDUzMjc3NzQ3MQ== 2448579 2019-09-18T17:07:39Z 2019-09-18T17:07:39Z MEMBER

This honestly makes no sense to me. da1 = xr.DataArray(name="a", data=[[0]], dims=["x", "y"]) da2 = xr.DataArray(name="b", data=[[1]], dims=["x", "y"]) da3 = xr.DataArray(name="a", data=[[2]], dims=["x", "y"]) da4 = xr.DataArray(name="b", data=[[3]], dims=["x", "y"]) xr.combine_nested([[da1, da2], [da3, da4]], concat_dim=["x", "y"])

These are dataarrays with two different names. Why is this the expected result? <xarray.DataArray 'a' (x: 2, y: 2)> array([[0, 1], [2, 3]]) Dimensions without coordinates: x, y

That error arises because it's trying to concatenate data_vars a and b but there are datasets that don't have a. If you set those DataArrays to have the same name, this will work.

``` da1 = xr.DataArray(name="a", data=[[0]], dims=["x", "y"]) da2 = xr.DataArray(name="a", data=[[1]], dims=["x", "y"]) da3 = xr.DataArray(name="a", data=[[2]], dims=["x", "y"]) da4 = xr.DataArray(name="a", data=[[3]], dims=["x", "y"])

ds1 = da1.to_dataset() ds2 = da2.to_dataset() ds3 = da3.to_dataset() ds4 = da4.to_dataset() xr.combine_nested([[ds1, ds2], [ds3, ds4]], concat_dim=["x", "y"]) ```

<xarray.Dataset> Dimensions: (x: 2, y: 2) Dimensions without coordinates: x, y Data variables: a (x, y) int64 0 1 2 3

ping @TomNicholas

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