home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 532778982

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-532778982 https://api.github.com/repos/pydata/xarray/issues/3315 532778982 MDEyOklzc3VlQ29tbWVudDUzMjc3ODk4Mg== 35968931 2019-09-18T17:11:42Z 2019-09-18T17:11:42Z MEMBER

Sorry when you say expected result are you referring to a particular unit test?

On Wed, 18 Sep 2019, 18:07 Deepak Cherian, notifications@github.com wrote:

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 https://github.com/TomNicholas

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/issues/3315?email_source=notifications&email_token=AISNPI36JGXYGON2QZCX4RLQKJN6DA5CNFSM4IXWOSZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7AYT7Y#issuecomment-532777471, or mute the thread https://github.com/notifications/unsubscribe-auth/AISNPIZPWVSS7SU2A3AEUMLQKJN6DANCNFSM4IXWOSZQ .

{
    "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.711ms · About: xarray-datasette