Unable to save DataFrame to HDF5 (“object header message is too large”)

前端 未结 4 1117
遇见更好的自我
遇见更好的自我 2020-12-10 05:05

I have a DataFrame in Pandas:

In [7]: my_df
Out[7]: 

Int64Index: 34 entries, 0 to 0
Columns: 2661 entries, airp         


        
4条回答
  •  自闭症患者
    2020-12-10 05:39

    As of 2014, the hdf is updated

    If you are using HDF5 1.8.0 or previous releases, there is a limit on the number 
    of fields you can have in a compound datatype. 
    This is due to the 64K limit on object header messages, into which datatypes are encoded. (However, you can create a lot of fields before it will fail.
    One user was able to create up to 1260 fields in a compound datatype before it failed.)
    

    As for pandas, it can save Dataframe with arbirtary number of columns with format='fixed' option, format 'table' still raises the same error as in topic. I've also tried h5py, and got the error of 'too large header' as well (though I had version > 1.8.0).

提交回复
热议问题