Skip to content

Encoding lost upon concatenation #1297

Closed
@gerritholl

Description

@gerritholl

When using xarray.concat, attributes are retained, but encoding information is not. I believe encoding information should be retained, at least optionally.

In [64]: da = xarray.DataArray([1, 2, 3, 2, 1])

In [65]: da.attrs.update(foo="bar")

In [66]: da.encoding.update(complevel=5)

In [67]: da2 = xarray.concat((da, da), dim="new")

In [68]: print(da2.attrs)
OrderedDict([('foo', 'bar')])

In [69]: print(da2.encoding)
{}

Metadata

Metadata

Assignees

No one assigned

    Labels

    staletopic-metadataRelating to the handling of metadata (i.e. attrs and encoding)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions