View number of lines in hdf5 file in pandas

I was wondering if there is a way to easily, quickly and without loading the whole file, getting the number of lines in the hdf5 file generated with pandas with pandas?

Thank you in advance!

+3


source to share


1 answer


In [1]: DataFrame(np.random.randn(10,10)).to_hdf('test.h5','df',mode='w',format='table')

In [3]: store = pd.HDFStore('test.h5')

In [4]: store
Out[4]: 
<class 'pandas.io.pytables.HDFStore'>
File path: test.h5
/df            frame_table  (typ->appendable,nrows->10,ncols->10,indexers->[index])

In [5]: store.get_storer('df').nrows
Out[5]: 10

      



+11


source







All Articles