HDFStore启动停止不起作用 [英] HDFStore start stop not working
问题描述
很清楚我在做什么错吗?
Is it clear what I am doing wrong?
我正在尝试熊猫HDFStore.选择 start 和 stop 选项,并没有什么改变.
I'm experimenting with pandas HDFStore.select start and stop options and it's not making a difference.
我正在使用的命令是:
import pandas as pd
hdf = pd.HDFStore(path % 'results')
len(hdf.select('results',start=15,stop=20))
希望长度为4或5,或者算在内,但这给了我整个数据数据帧.
hoping to get a length of 4 or 5 or however it's counted, but it gives me the whole darn dataframe.
以下是屏幕截图:
推荐答案
在写入h5文件时,选择pandas.to_hdf(<path>,<key>,format='tables')
可以选择商店的子集.但是,这是一个错误,您应该会得到一个错误.
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.
根据Jeff( https://stackoverflow.com/users/644898/jeff ),
这是一个已知的错误,并在此处进行了修复:github.com/pydata/pandas/issues/8287
this is a known bug and has a fix here: github.com/pydata/pandas/issues/8287
欢迎拉动请求.
这篇关于HDFStore启动停止不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!