pandas HDFStore - how to reopen?

前端 未结 3 1043
天命终不由人
天命终不由人 2021-02-12 11:22

I created a file by using:

store = pd.HDFStore(\'/home/.../data.h5\')

and stored some tables using:

store[\'firstSet\'] = df1
s         


        
3条回答
  •  春和景丽
    2021-02-12 11:55

    You could try doing instead:

    store = pd.io.pytables.HDFStore('/home/.../data.h5')
    df1 = store['firstSet']
    

    or use the read method directly:

    df1 = pd.read_hdf('/home/.../data.h5', 'firstSet')
    

    Either way, you should have pandas 0.12.0 or higher...

提交回复
热议问题