When I try to store a masked array, I get only an incomprehensible error message:
ValueError: cannot reshape array of size 3 into shape (24,)
See "example 1" for details.
When I use zarr 2 (or zarr 3 with zarr_format=2), there is no error but the mask is just lost. See "example 2".
Example 1
import numpy
import zarr
masked_array = numpy.ma.masked_array([1, 2, 3], mask=[0, 1, 0])
zarr_array = zarr.array(masked_array)
Error Message:
ValueError: cannot reshape array of size 3 into shape (24,)
Example 2
import numpy
import zarr
masked_array = numpy.ma.masked_array([1, 2, 3], mask=[0, 1, 0])
print(masked_array)
zarr_array = zarr.array(masked_array, zarr_format=2)
print(zarr_array[:])
Output:
When I try to store a masked array, I get only an incomprehensible error message:
See "example 1" for details.
When I use zarr 2 (or zarr 3 with
zarr_format=2), there is no error but the mask is just lost. See "example 2".Example 1
Error Message:
Example 2
Output: