Skip to content

Can I add custom user-attributes at once? #3388

Closed Answered by TomAugspurger
paulshuker asked this question in Q&A
Discussion options

You must be logged in to vote

You can use .update:

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 Group.update_attributes? My example might have only worked since it was an in-memory store...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@d-v-b
Comment options

Answer selected by paulshuker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants