Can I add custom user-attributes at once? #3388
-
Hey, If I have a group.attrs["a"] = 0
group.attrs["b"] = 1 I get a warning on the second addition as a ZipStore cannot modify existing files as far as I understand. I checked the Tutorial and the Group API but I could not find anything. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use In [1]: import zarr
In [2]: store = zarr.storage.MemoryStore()
In [4]: g = zarr.create_group(store, path="g")
In [6]: g.attrs.update({"a": 1, "b": 2}) A PR improving the documentation here would be very welcome. Edit: actually, maybe the recommended way is to use |
Beta Was this translation helpful? Give feedback.
You can use
.update
:A PR improving the documentation here would be very welcome.
Edit: actually, maybe the recommended way is to use
Group.update_attributes
? My example might have only worked since it was an in-memory store...