numpy array average code example
Example 1: numpy average
import numpy as np
a = np.arange(6).reshape(3,2)
average = np.average(a)
Example 2: python mean ndarray
# define ndarray a
a = np.array([[1, 2], [3, 4]])
# get the mean
np.mean(a, axis=None)