def read_hdf(hdf_fname, key):
"""
Read contents of HDF file *hdf_fname* associated with *key* and
return a :class:`DataFrame`, header tuple.
"""
if not os.path.isfile(hdf_fname):
raise ValueError('file {} does not exist'.format(hdf_fname))
with PD.HDFStore(hdf_fname) as store:
df = store.get(key)
header = store.get_storer(key).attrs.header
return df, header
评论列表
文章目录