HDFStore start stop not working

两盒软妹~` 提交于 2020-01-05 07:34:46

问题


Is it clear what I am doing wrong?

I'm experimenting with pandas HDFStore.select start and stop options and it's not making a difference.

The commands I'm using are:

import pandas as pd 
hdf = pd.HDFStore(path % 'results')
len(hdf.select('results',start=15,stop=20))

hoping to get a length of 4 or 5 or however it's counted, but it gives me the whole darn dataframe.

Here is a screenshot:


回答1:


When writing to the h5 file, select pandas.to_hdf(<path>,<key>,format='tables') which enables subsets of the store to be selected. However, this is a bug as you should get an error.

According to Jeff (https://stackoverflow.com/users/644898/jeff),

this is a known bug and has a fix here: github.com/pydata/pandas/issues/8287

Pull requests welcome.



来源:https://stackoverflow.com/questions/26963654/hdfstore-start-stop-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!