Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'P': [2, 3, 4], 'Q': [5, 6, 7]},
index=['p', 'q', 'r'])
df.to_hdf('data.h5', key='df', mode='w')
We can add another object to the same file:
s = pd.Series([2, 3, 4, 5])
s.to_hdf('data.h5', key='s')
Reading from HDF file:
pd.read_hdf('data.h5', 'df')
pd.read_hdf('data.h5', 's')
Deleting file with data:
import os
os.remove('data.h5')