所以,我一直在寻找方法,把所有的数字四舍五入到一个麻木的数组中。我发现了两个类似的函数,numpy.round和numpy.around。对于像我这样的初学者来说,两人似乎都有相同的观点。
那么,这两者在以下方面的区别是什么:
一般性差异
速度
准确度
在实践中使用

最佳答案

They are the exact same function

def round_(a, decimals=0, out=None):
    """
    Round an array to the given number of decimals.
    Refer to `around` for full documentation.
    See Also
    --------
    around : equivalent function
    """
    return around(a, decimals=decimals, out=out)

07-24 15:42