monty.py 文件源码

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

项目:monty 作者: boppreh 项目源码 文件源码
def normalize(self):
        """
        Returns a new distribution with the probabilities normalized so that
        their total sums to 1.
        """
        if math.isclose(self.total, 1) or self.total == 0:
            return self
        return Distribution(*((v, p/self.total) for v, p in self), force_flatten=self.force_flatten, force_merge=self.force_merge)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号