October 2019
Beginner to intermediate
674 pages
16h 43m
English
A wide range of statistical operations, such as computing mean, median, variance, and standard deviation, can be calculated for NumPy arrays using the available statistical operators. The aggregates, such as mean, median, variance, and standard deviation, for an entire array can be calculated as shown in the following code:
In [16]: array_x = np.array([[0, 1, 2], [3, 4, 5]])In [17]: np.mean(array_x)Out[17]: 2.5In [18]: np.median(array_x)Out[18]: 2.5In [19]: np.var(array_x)Out[19]: 2.9166666666666665In [20]: np.std(array_x)Out[20]: 1.707825127659933
By default, these statistical parameters are computed by flattening out the array. To compute the statistical parameters along any of the axes, the axis argument can be defined ...
Read now
Unlock full access