storage.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:catwalk 作者: dssg 项目源码 文件源码
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]]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号