Skip to content

Geometric mean

Maurice HT Ling edited this page Aug 13, 2021 · 2 revisions

Purpose: To calculate geometric mean of a data set.

Code:

>>> from scipy import stats
>>> X = [9.07, 8.97, 6.41, 3.03, 1.19, 2.67, 2.81, 9.2]
>>> result = stats.gmean(X)
>>> print("Geometric mean = %.2f" % result)
Geometric mean = 4.36
Clone this wiki locally