擅长:python、mysql、java
<p><strong>读取文件</strong></p>
<pre><code>import h5py
f = h5py.File(file_name, mode)
</code></pre>
<p><strong>通过打印HDF5组来研究文件的结构</strong></p>
<pre><code>for key in f.keys():
print(key) #Names of the groups in HDF5 file.
</code></pre>
<p><strong>提取数据</strong></p>
<pre><code>#Get the HDF5 group
group = f[key]
#Checkout what keys are inside that group.
for key in group.keys():
print(key)
data = group[some_key_inside_the_group].value
#Do whatever you want with data
#After you are done
f.close()
</code></pre>