Open
Description
I am finding myself wanting to apply an operation (e.g., thresholding) on every chunk in an array. It would therefore be nice if there was an easy way to iterate through each chunk of the array.
Something like:
for i, chunk in enumerate(zarr_arr.all_chunks):
zarr.all_chunks[i] = np.clip(chunk, min, max)
This is sort of similar to block indexing, but iterating over Array.blocks
only iterates over the first axis of blocks, and gives you back all the chunks along the other axes.