xarray.Dataset.to_zarr: overwrite data if exists with append_dim #4705
Unanswered
wankoelias
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I originaly posted this here on stack overflow. But since writing to zarr is still experimental im not sure if this behaviour is a bug, a possible feature or just wrong usage of xarray.
With xarray.Dataset.to_zarr it is possible to write an xarray to a
.zarr
file and append new data along a dimension using theappend_dim
parameter.However, if the coordinate of the new data for this dimension is already there, the existing data won't be replaced. Rather the same coordinate appears twice in the resulting dateset.
Example:
Here I write 2 Datasets to the same .zarr file. The datasets are appended along the
space
dimension. Both datasets contain the same space coordinate"IL"
When reading the file, the second dataset didn't overwrite the data for the
"IL"
coordinate, but crated a new one:This would be my desired result:
Beta Was this translation helpful? Give feedback.
All reactions