As an example here's some python code that writes a xarray dataset into netcdf and zarr (version 2):
import xarray as xr
ds = xr.Dataset({'var':123456789})
ds.to_netcdf('xr.nc')
ds.to_zarr('xr.zarr')
In netcdf the scalar is well interpreted:
$ ncdump xr.nc
netcdf xr {
variables:
int var ;
data:
var = 123456789 ;
}
In zarr the scalar variable is suppressed:
$ ncdump -L 0 file://${PWD}/xr.zarr#mode=zarr,file
WARN: Empty shape for variable var suppressed
netcdf xr {
}
As an example here's some python code that writes a xarray dataset into netcdf and zarr (version 2):
In netcdf the scalar is well interpreted:
In zarr the scalar variable is suppressed: