h5sparse.py 文件源码

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

项目:h5sparse 作者: appier 项目源码 文件源码
def __getitem__(self, key):
        h5py_item = self.h5py_group[key]
        if isinstance(h5py_item, h5py.Group):
            if 'h5sparse_format' in h5py_item.attrs:
                # detect the sparse matrix
                return Dataset(h5py_item)
            else:
                return Group(h5py_item)
        elif isinstance(h5py_item, h5py.Dataset):
            return h5py_item
        else:
            raise ValueError("Unexpected item type.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号