We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! There are problems when working with NumPy Structured arrays containing an object.
Given the NumPy composite type: records_dtype = [('col1', object), ('col2', np.float64)]
records_dtype = [('col1', object), ('col2', np.float64)]
In numpy, data is retrieved by the name of the column, but in zarr this does not work:
arr = np.array([('1', 1.0), ('22', 2.0), ('333', 3.0)], dtype=records_dtype) print(arr['col1'])
When creating dataset an exception occurs: ds = zarr.array(arr) zarr.errors.MetadataError: error decoding metadata: Cannot change data-type for object array.
ds = zarr.array(arr)
If you pass 'fill_value = None' to zarr.array(), the dataset is created and the values from it can be read:
zarr.array()
ds = zarr.array(arr, fill_value=None) print(ds[:])
But data retrieval by column name does not work: print(ds['col1']) ValueError: cannot create an OBJECT array from memory buffer
print(ds['col1'])
The text was updated successfully, but these errors were encountered:
Fixed by #813 (v2.9.4)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hello!
There are problems when working with NumPy Structured arrays containing an object.
Given the NumPy composite type:
records_dtype = [('col1', object), ('col2', np.float64)]
In numpy, data is retrieved by the name of the column, but in zarr this does not work:
When creating dataset an exception occurs:
ds = zarr.array(arr)
zarr.errors.MetadataError: error decoding metadata: Cannot change data-type for object array.
If you pass 'fill_value = None' to
zarr.array()
, the dataset is created and the values from it can be read:But data retrieval by column name does not work:
print(ds['col1'])
ValueError: cannot create an OBJECT array from memory buffer
The text was updated successfully, but these errors were encountered: