stats.py 文件源码

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

项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码
def atmax(a,upperlimit,dimension=None,inclusive=1):
    """
   Returns the maximum value of a, along dimension, including only values greater
   than (or equal to, if inclusive=1) upperlimit.  If the limit is set to None,
   a limit larger than the max value in the array is used.

   Usage:   atmax(a,upperlimit,dimension=None,inclusive=1)
   """
    if inclusive:         upperfcn = N.less
    else:               upperfcn = N.less_equal
    if dimension == None:
        a = N.ravel(a)
        dimension = 0
    if upperlimit == None:
        upperlimit = N.maximum.reduce(N.ravel(a))+1
    smallest = N.minimum.reduce(N.ravel(a))
    ta = N.where(upperfcn(a,upperlimit),a,smallest)
    return N.maximum.reduce(ta,dimension)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号