Answers for "geometric mean python"

2

how to find geometric mean in python

>>> from scipy.stats.mstats import gmean
>>> gmean([1.0, 0.00001, 10000000000.])
46.415888336127786
Posted by: Guest on December-31-2020
1

geometrical mean python

import numpy as np

def geo_mean(iterable):
    a = np.array(iterable)
    return a.prod()**(1.0/len(a))
Posted by: Guest on December-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language