scipy.stats.mean(a, axis=0)

Returns the arithmetic mean of m along the given dimension.

That is: (x1 + x2 + .. + xn) / n

Parameters :

a : array

axis : int or None

Returns :

The arithmetic mean computed over a single dimension of the input array or :

all values in the array if axis=None. The return value will have a floating :

point dtype even if the input data are integers. :


scipy.stats.mean is deprecated; please update your code to use numpy.mean.

Please note that:
  • numpy.mean axis argument defaults to None, not 0

  • numpy.mean has a ddof argument to replace bias in a more general manner.

  • scipy.stats.mean(a, bias=True) can be replaced by

    numpy.mean(x, axis=0, ddof=1)

removed in scipy 0.8.0

Previous topic


Next topic


This Page