python-blosc2 icon indicating copy to clipboard operation
python-blosc2 copied to clipboard

Allow to create an array with shape = (0, 0)

Open martaiborra opened this issue 2 years ago • 0 comments

The next example should work.

import blosc2


shape = (0, 0)
# Create an array
a = blosc2.zeros(shape, chunks=(10, 10), blocks=(5,5))
a.resize((5,5))
# Get slice as a NumPy array
print(a[:5, :5])

a[:5, :5] = 0

print(a[...])

martaiborra avatar Jun 21 '23 11:06 martaiborra