h5py
import h5py
def print_attrs(name, obj):
print(name,'--name')
if isinstance(obj, h5py.Dataset):
print(" shape:", obj.shape)
print(" dtype:", obj.dtype)
else:
for key, val in obj.attrs.items():
print(" %s: %s" % (key, val))
def traverse_hdf5(f):
for key in f.keys():
print_attrs(key, f[key])
if isinstance(f[key], h5py.Group):
traverse_hdf5(f[key])
with h5py.File('channels-7.h5', 'r') as f:
traverse_hdf5(f)
import h5py
def print_attrs(name, obj):
print(name,'--name')
if isinstance(obj, h5py.Dataset):
print(" shape:", obj.shape)
print(" dtype:", obj.dtype)
else:
for key, val in obj.attrs.items():
print(" %s: %s" % (key, val))
def traverse_hdf5(f):
for key in f.keys():
print_attrs(key, f[key])
if isinstance(f[key], h5py.Group):
traverse_hdf5(f[key])
with h5py.File('channels-7.h5', 'r') as f:
traverse_hdf5(f)