no_numba.py 文件源码

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

项目:dc_stat_think 作者: justinbois 项目源码 文件源码
def _allequal(x, rtol=1e-5, atol=1e-14):
    """
    Determine if all entries in an array are equal.

    Parameters
    ----------
    x : ndarray
        Array to test.

    Returns
    -------
    output : bool
        True is all entries in the array are equal, False otherwise.
    """
    if len(x) == 1:
        return True

    for a in x[1:]:
        if np.abs(a-x[0]) > (atol + rtol * np.abs(a)):
            return False
    return True


# @numba.jit(nopython=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号