I\'m doing some statistics work, I have a (large) collection of random numbers to compute the mean of, I\'d like to work with generators, because I just need to compute the
The old-fashioned way to do it:
def my_mean(values): sum, n = 0, 0 for x in values: sum += x n += 1 return float(sum)/n