HDFStore start stop not working

925 views Asked by At

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:enter image description here

1

There are 1 answers

0
user3659451 On

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.