Skip to content

Scalar coords vs. concat #1151

Open
Open
@crusaderky

Description

@crusaderky

Why does this work:

>> import xarray
>> a = xarray.DataArray([1, 2, 3], dims=['x'], coords={'y': 10})
>> b = xarray.DataArray([4, 5, 6], dims=['x'])
>> a + b
<xarray.DataArray (x: 3)>
array([5, 7, 9])
Coordinates:
    y        int64 10

But this doesn't?

>> xarray.concat([a, b], dim='x')
KeyError: 'y'

It doesn't seem coherent to me...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions