我有一個my_file.h5
文件,據推測,它包含HDF5格式的數據(PyTables)。我嘗試用熊貓來讀取這個文件:如何從熊貓閱讀HDF表?
import pandas as pd
store = pd.HDFStore('my_file.h5')
然後我嘗試使用store
對象:
print store
結果我得到:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/pandas/io/pytables.py", line 133, in __repr__
kind = v._v_attrs.pandas_type
File "/usr/lib/python2.7/dist-packages/tables/attributeset.py", line 302, in __getattr__
(name, self._v__nodePath)
AttributeError: Attribute 'pandas_type' does not exist in node: '/data'
有誰知道我是什麼我做錯了?問題可能是由於我的*.h5
不是我認爲的(不是hdf5格式的數據)而導致的?
您將需要至少0.10.1(現在0.11出來),讀取非熊貓創建的HDF5表,您可以執行''ptdump -avd file.h5''來檢查它是順便說一句 – Jeff 2013-04-23 14:41:32