collections.py 文件源码

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

项目:bayestsa 作者: thalesians 项目源码 文件源码
def tonumpyarray(self, fill=None, symmetric=False):
        import numpy as np
        if fill is None: fill = np.NAN
        res = np.empty((self.__dim, self.__dim))
        idx = 0
        for i in range(self.__dim):
            for j in range(i):
                res[i,j] = self._data[idx]
                if symmetric: res[j,i] = res[i,j]
                idx += 1
            res[i,i] = fill
            if not symmetric: res[i,i+1:self.__dim] = fill
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号