Types of mean
Jump to navigation
Jump to search
Main article: Average
With Python code for an array-like a.
Mean | Remarks | NumPy function | SciPy function |
---|---|---|---|
Arithmetic[1] | the sum divided by the population size, n — used when the sum is of interest | numpy.mean(a) |
|
Geometric [1][2] | the nth root of the product — used when the product is of interest | scipy.stats.mstats.gmean(a)
| |
Harmonic [1] | n divided by the sum of the reciprocals — used for rates and ratios | scipy.stats.mstats.hmean(a)
| |
Quadratic or RMS | the square root of the arithmetic mean of the squares — used for magnitudes | np.sqrt(np.mean(a**2)) |
See also
External links
- What do you mean by average? — blog post at Agile Geoscience