import h5py
# Create some example HDF5 data to show
f = h5py.File("example.h5", "w")
f.create_dataset("/group1/subgroup1/dataset1", (200,), dtype='u8')
f.create_dataset("/group1/subgroup1/dataset2", (2, 128, 500), dtype='f4')
f.create_dataset("/group1/subgroup2/dataset1", (12,), dtype='i2')
# Basic h5py repr
f
<HDF5 file "example.h5" (mode r+)>
from h5glance import H5Glance
H5Glance(f)
H5Glance(f['group1/subgroup1'])
Install a display hook for IPython so all h5py
files & groups are viewed this way.
import h5glance
h5glance.install_ipython_h5py_display()
f
f['group1']