weighted_statistics.py 文件源码

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

项目:pyabc 作者: neuralyzer 项目源码 文件源码
def weighted_median(points, weights):
        sorted_indices = sp.argsort(points)
        points = points[sorted_indices]
        weights = weights[sorted_indices]
        cs = sp.cumsum(weights)
        median = sp.interp(.5, cs - .5*weights, points)
        return median
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号