statistics.geometric_mean
Prev: statistics.fmean | Up: statistics | Next: statistics.harmonic_mean
Rel: statistics.correlation, statistics.covariance, statistics.fmean, statistics.harmonic_mean
Ref: docs.python.org — statistics.geometric_mean
Tags: #public #python3 #stdlib #statistics
Import
import statistics
from statistics import geometric_mean
Signature & Overview
statistics.geometric_mean(data)
Convert data to floats and compute the geometric mean.
Usage
import statistics
assert round(statistics.geometric_mean([4, 9]), 6) == 6.0
Gotchas
- All values must be strictly positive (
> 0): Zero or negative inputs raiseStatisticsError.
REPL Inspect
from statistics import geometric_mean
help(geometric_mean)
Linked from
- tuts/python3/stdlib_module/statistics
- tuts/python3/stdlib_module/statistics/correlation
- tuts/python3/stdlib_module/statistics/covariance
- tuts/python3/stdlib_module/statistics/fmean
- tuts/python3/stdlib_module/statistics/harmonic_mean
- tuts/python3/stdlib_module/statistics/kde
- tuts/python3/stdlib_module/statistics/kde_random
- tuts/python3/stdlib_module/statistics/linear_regression
- tuts/python3/stdlib_module/statistics/mean
- tuts/python3/stdlib_module/statistics/median
- tuts/python3/stdlib_module/statistics/median_grouped
- tuts/python3/stdlib_module/statistics/median_high
- tuts/python3/stdlib_module/statistics/median_low
- tuts/python3/stdlib_module/statistics/mode
- tuts/python3/stdlib_module/statistics/multimode
- tuts/python3/stdlib_module/statistics/NormalDist
- tuts/python3/stdlib_module/statistics/pstdev
- tuts/python3/stdlib_module/statistics/pvariance
- tuts/python3/stdlib_module/statistics/quantiles
- tuts/python3/stdlib_module/statistics/StatisticsError
- tuts/python3/stdlib_module/statistics/stdev
- tuts/python3/stdlib_module/statistics/variance
Related notes
- tuts/python3/stdlib_module/statistics/correlation Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/covariance Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/fmean Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/harmonic_mean Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/statistics/kde links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/kde_random links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/linear_regression links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/mean links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/median links to this page; shared tags: #statistics, #stdlib