How can I resize an HDF5 array using the h5py
Python library ?
I've tried using the .resize
method and on an array with chunks
set to True
. Alas, I'm still missing something.
In [1]: import h5py
In [2]: f = h5py.File('foo.hdf5', 'w')
In [3]: d = f.create_dataset('data', (3, 3), dtype='i8', chunks=True)
In [4]: d.resize((6, 3))
/home/mrocklin/Software/anaconda/lib/python2.7/site-packages/h5py/_hl/dataset.pyc in resize(self, size, axis)
--> 277 self.id.set_extent(size)
ValueError: unable to set extend dataset (Dataset: Unable to initialize object)
In [11]: h5py.__version__
Out[11]: '2.2.1'
maxshape
oncreate_dataset
? – SlightlyCubanmaxshape
allocate that much space on disk? Why not set it infinite? – MRocklin