You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to create a zarr array with numpy array as data. I tried to use zarr_array = zarr.array(data = data). It errors out saying,
AttributeError: 'dict' object has no attribute 'encode'. Maybe we need to pass in the compressor as a dictionary.
Zarr version
v2.18.3
Numcodecs version
v0.13.1
Python Version
3.10
Operating System
Linux
Installation
uv pip install zarr
Description
Unable to create a zarr array with numpy array as data. I tried to use zarr_array = zarr.array(data = data). It errors out saying,
AttributeError: 'dict' object has no attribute 'encode'. Maybe we need to pass in the compressor as a dictionary.
Steps to reproduce
n [1]: import zarr
In [2]: import numpy as np
In [3]: data = np.ones([1,1])
In [4]: data
Out[4]: array([[1.]])
In [5]: zarr_array = zarr.array(data = data)
2393 # compress
2394 if self._compressor:
-> 2395 cdata = self._compressor.encode(chunk)
2396 else:
2397 cdata = chunk
AttributeError: 'dict' object has no attribute 'encode'
Additional output
The text was updated successfully, but these errors were encountered: