当前位置:网站首页>. H5 file forgets the database name and uses h5py to print

. H5 file forgets the database name and uses h5py to print

2022-06-23 07:26:00 NuerNuer

We read .h5 When you file , commonly :

import h5py

path = 'xxx.h5'

with h5py.File(path, 'r') as h5_file:
    data = h5_file.get(' Database name ')[...]

But sometimes , For a variety of reasons , We forget the name of the database , Will cause the read to fail .

terms of settlement :

for key in h5_file.keys():
    print(h5_file[key].name)

This will print out database The name of , We can use it normally

原网站

版权声明
本文为[NuerNuer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230606381966.html