I have a dataframe which I store in a HDF file with the following command:
# store data in HDF5 format
store = pd.HDFStore('data.h5')
store.put('data',data)
store.close()
It works all fine. In another code, I load the dataframe again, which also works fine, and store it again after adding two columns.
Load:
df = pd.read_hdf('data.h5', key=None, mode='r')
And save again:
store = pd.HDFStore('data.h5')
store.put('data',data)
store.close()
However, when saving the second time, I get the following warning:
PerformanceWarning: your performance may suffer as PyTables will pickle object types that it cannot map directly to c-types [inferred_type->mixed,key->block3_values] [items->['a', 'b', 'c']]
if self.run_code(code, result):
Interestingly, the warning does not refer to the two added columns, but to columns that were saved completely fine the first time and not touched in the code. Is there something that pd.read_hdf
does to the column types or so? Or am I missing something?
Thank you