问题
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