1. 程式人生 > >pandas21 hdf檔案讀寫簡要( tcy)

pandas21 hdf檔案讀寫簡要( tcy)

hdf檔案讀寫 2018/12/27

import tables

df=pd.DataFrame({'No':[1001,1002,1003],'Name':['Tom','Bob','Jim'],'Weight':[20,30,40]})

df.to_hdf('foo.h5','df')
pd.read_hdf('foo.h5','df')
     No   Name  Weight
0  1001  Tom        20
1  1002  Bob        30
2  1003  Jim        40