理解numpy.average

  • numpy.average

    numpy.average(a, axis=None, weights=None, returned=False)

    Compute the weighted average along the specified axis.

  • Parameters

    Param Type Meaning
    a array_like Array containing data to be averaged.
    axis None or int or tuple of ints, optional Axis or axes along which to average a
    weights array_like, optional An array of weights associated with the values in a
    returned bool, optional If True, the tuple(average, sum_of_weights) is returned, otherwise only the average is returned.

    Returns, retval, [sum_of_weights] : array_type or double.

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/109230500