mean of a numpy array code example
Example 1: mean of a vector in python
>>> import numpy
>>> numbers = [3, 2, 8, 7]
>>> mean = numpy.mean(numbers)
>>> mean
5.0
Example 2: python mean ndarray
# define ndarray a
a = np.array([[1, 2], [3, 4]])
# get the mean
np.mean(a, axis=None)