def _read_hdf_from_buffer(self, buffer):
with pandas.HDFStore(
"data.h5",
mode="r",
driver="H5FD_CORE",
driver_core_backing_store=0,
driver_core_image=buffer.read()) as store:
if len(store.keys()) > 1:
raise Exception('Ambiguous matrix store. More than one dataframe in the hdf file.')
try:
return store["matrix"]
except KeyError:
print("The hdf file should contain one and only key, matrix.")
return store[store.keys()[0]]
评论列表
文章目录