擅长:python、mysql、java
<p>我可能已经找到了一个解决方案,但不确定(1)它为什么有效,(2)这是否是一个稳健的解决方案。在</p>
<pre><code>import tables
h5 = tables.openFile('data.h5', mode='r')
df_node = h5.root.__getattr__('tablename')
# Not sure why `axis0` contains the column data, but it seems consistent
# with the tested h5 files.
columns = df_node.axis0[:]
</code></pre>
<p><code>columns</code>包含一个包含所有列名的<code>numpy</code>数组。在</p>