PyDocs

Nav

Numeric and Mathematical Modules

geometric_mean

statistics

function · Added in 3.8 (source)
  • geometric_mean(data)
Convert data to floats and compute the geometric mean.

Raises a StatisticsError if the input dataset is empty
or if it contains a negative value.

Returns zero if the product of inputs is zero.

No special efforts are made to achieve exact results.
(However, this may change in the future.)

>>> round(geometric_mean([54, 24, 36]), 9)
36.0
1 Example
>>> round(geometric_mean([54, 24, 36]), 1)
36.0
from the Python docs
See Also
No see-alsos for statistics/geometric_mean
0 Notes
No notes for geometric_mean