Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: HDFStore.select ignores start and stop parameters #8287

Closed
TomAugspurger opened this issue Sep 17, 2014 · 4 comments
Closed

BUG: HDFStore.select ignores start and stop parameters #8287

TomAugspurger opened this issue Sep 17, 2014 · 4 comments
Labels
Bug Docs IO HDF5 read_hdf, HDFStore

Comments

@TomAugspurger
Copy link
Contributor

Or I'm doing this wrong

In [1]: df = pd.DataFrame(np.random.randn(10, 4))

In [3]: df.to_hdf('test.h5', 'df')

In [4]: with pd.get_store('test.h5') as store:
   ...:     df_ = store.select('df', start=0, stop=2)
   ...:     

In [5]: df_
Out[5]: 
          0         1         2         3
0  1.504814  0.209394 -0.360703 -0.339684
1  0.272718  0.768927 -1.061029  0.919742
2  0.315669  0.337206 -1.358443  1.223715
3 -0.414095  0.015512 -0.320634  0.703489
4  0.889063 -0.194524  1.342604  1.078340
5 -1.636940 -0.725176 -0.096803  0.346356
6 -1.359400 -0.588007  0.651720 -0.127604
7 -1.613468  1.131560 -0.074385 -0.830540
8  0.176463 -1.298918 -0.215537  0.984911
9 -0.372920  0.898528 -0.869616  1.178704

Docstring says:

start : integer (defaults to None), row number to start selection
stop  : integer (defaults to None), row number to stop selection

I can look tomorrow (catching up on pandas stuff all day tomorrow hopefully)

@TomAugspurger TomAugspurger added Bug IO HDF5 read_hdf, HDFStore labels Sep 17, 2014
@jreback
Copy link
Contributor

jreback commented Sep 17, 2014

that's a fixed store

only table implements these

they could be for a fixed store (though inefficient I think)

@TomAugspurger
Copy link
Contributor Author

OK thanks. I'll add a note to the docstring.

@TomAugspurger TomAugspurger added Docs and removed Bug labels Sep 17, 2014
@jreback
Copy link
Contributor

jreback commented Sep 17, 2014

actually it should work - maybe raise NotImplemented error for now

http://pytables.github.io/usersguide/libref/homogenous_storage.html#the-array-class

@jreback jreback added this to the 0.15.1 milestone Oct 2, 2014
@jreback jreback added the Bug label Oct 2, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jreback
Copy link
Contributor

jreback commented Mar 17, 2015

here's partway to an implementation of this: http://stackoverflow.com/questions/29069592/read-n-rows-from-an-h5-file/29089216#29089216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Docs IO HDF5 read_hdf, HDFStore
Projects
None yet
2 participants