iop.py 文件源码

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

项目:blackbox 作者: wrwrwr 项目源码 文件源码
def instantiate_dist(name, *opts):
    """
    Creates distribution for the given command-line arguments.
    """
    try:
        dist = getattr(stats, name)
    except AttributeError:
        raise ValueError("No such distribution {}".format(name))
    opts = list(opts)
    try:
        loc = float(opts.pop(0))
    except IndexError:
        loc = 0
    try:
        scale = float(opts.pop(0))
    except IndexError:
        scale = 1
    return dist(*map(float, opts), loc=loc, scale=scale)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号