我將數據存儲在hdf5文件中。奇怪的是我選擇了一個具有相同條件的表,但HDFStore給出了不同的答案。選擇條件相同,但HDFStore給出不同的答案
誰能告訴我爲什麼?
In [2]: import pandas as pd
In [3]: store=pd.HDFStore("./data/m2016.h5","r")
In [4]: store
Out[4]:
<class 'pandas.io.pytables.HDFStore'>
File path: ./data/m2016.h5
/m2016 frame_table (typ->appendable,nrows->37202055,ncols->6,indexers->[index],dc->[dt,code])
In [5]: a=store.select('m2016',where="code='000001'")
In [6]: b=store.select('m2016',where="code='000001'")
In [7]: a.shape
Out[7]: (2388318, 6)
In [8]: b.shape
Out[8]: (2374525, 6)
In [9]: a.head()
Out[9]:
dt market code price volume preclose
85920 2016-01-04 09:30:00 0 000001 11.98 1102900 11.99
85921 2016-01-04 09:31:00 0 000001 11.96 289100 11.99
85922 2016-01-04 09:32:00 0 000001 11.97 361800 11.99
85923 2016-01-04 09:33:00 0 000001 12.00 279200 11.99
85924 2016-01-04 09:34:00 0 000001 12.00 405600 11.99
我測試了它在我所有的三臺電腦,結果爲:
PC1,操作系統:Win2012server,蟒蛇:winpython 2.7.10.3(64位),選擇結果是錯誤的。
PC2,os:Win10,python winpython 2.7.10.3(64bits),select result is wrong。
PC3,os:Win7,python:Winpython 2.7.10.3(64bits),select result is ok!
也許HDFStore.select只能運行在Win7上?
我測試了它在我的三臺電腦,結果爲: – hoot
你檢查你的熊貓的版本不同的電腦上? – jrjc