CoCalc Public Filestmp / h5py.ipynbOpen in with one click!
Author: William A. Stein
In [1]:
import h5py
In [2]:
a = h5py.File('foo.hdf5')
In [4]:
a['blah'] = 2/3
In [5]:
a['xxx'] = [1,2,3]
In [6]:
a
<HDF5 file "foo.hdf5" (mode r+)>
In [7]:
a.close()
In [5]:
x = a['blah']
In [11]:
x.value
/ext/anaconda5/lib/python3.6/site-packages/h5py/_hl/dataset.py:313: H5pyDeprecationWarning: dataset.value has been deprecated. Use dataset[()] instead. "Use dataset[()] instead.", H5pyDeprecationWarning)
0.6666666666666666
In [12]:
x[()]
0.6666666666666666
In [13]:
a['xxx'][()]
array([1, 2, 3])
In [ ]: