tasseography.py 文件源码

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

项目:psp 作者: cmap 项目源码 文件源码
def convert_percentile_to_thresh(g, percentile):
    """ Figure out what value in g corresponds to the given percentile.

    Args:
        @param g:
        @type g: igraph.Graph
        @param percentile: between 0 and 100
        @type percentile: float

    Returns:
        thresh

    """
    assert percentile < 100 and percentile > 0, (
        "percentile must be between 0 and 100. percentile: {}".format(percentile))

    thresh = np.nanpercentile(np.abs(g.es["weight"]), percentile)

    return thresh
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号