How to know HDF5 dataset name in python

懵懂的女人 提交于 2019-12-06 03:46:38

file is a python dictionary. Thus you can iterate over file and stock all datasets for example:

>>> file = h5py.File('file.h5', 'r')
>>> dataset = []
>>> for i in file.values():
...     dataset.append(i)
...     ...

If just for the list: list(file.values()).

Finally, if you just want the name of the datasets then:

list(file.keys())
['Patch_001-inlet', 'Patch_002-outlet', 'Patch_003-wall']
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!