geometrical mean python

36

import numpy as np

def geo_mean(iterable):
    a = np.array(iterable)
    return a.prod()**(1.0/len(a))

Comments

Submit
0 Comments