Skip to content

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Sep 16, 2025

Zarr stores written with Xarray now consistently use a default Zarr fill value of NaN for float variables, for both Zarr v2 and v3. All other dtypes still use the Zarr default fill_value of zero. To customize, explicitly set encoding in Dataset.to_zarr, e.g., encoding=dict.fromkey(ds.data_vars, {'fill_value': 0}).

Fixes #10646

Zarr stores written with Xarray now consistently use a default Zarr fill value
of ``NaN`` for float variables, for both Zarr v2 and v3. All
other dtypes still use the Zarr default ``fill_value`` of zero. To customize,
explicitly set encoding in :py:meth:`~Dataset.to_zarr`, e.g.,
``encoding=dict.fromkey(ds.data_vars, {'fill_value': 0})``.

Fixes pydata#10646
@github-actions github-actions bot added topic-backends topic-zarr Related to zarr storage library io labels Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io topic-backends topic-zarr Related to zarr storage library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unwritten Zarr v3 arrays values should default to NaN
1 participant