I\'m trying to write data from a Pandas dataframe into a nested hdf5 file, with multiple groups and datasets within each group. I\'d like to keep it as a single file which w
df.to_hdf() expects a string as a key parameter (second parameter):
key
key : string identifier for the group in the store
key : string
identifier for the group in the store
so try this:
df.to_hdf('database.h5', ds.name, table=True, mode='a')
where ds.name should return you a string (key name):
ds.name
In [26]: ds.name Out[26]: '/A1'