How do I traverse all the groups and datasets of an hdf5 file using h5py?
I want to retrieve all the contents of the file from a common root using a for loop or something similar.
h5py
How do I traverse all the groups and datasets of an hdf5 file using h5py?
I want to retrieve all the contents of the file from a common root using a for loop or something similar.
Best Answer
visit()
andvisititems()
are your friends here. Cf. http://docs.h5py.org/en/latest/high/group.html#Group.visit. Note that anh5py.File
is also anh5py.Group
. Example (not tested):