""" Statistics module - mean - variance - standard deviation - min/max value """ def variance(l): a = std_deviation(l) return a*a def std_deviation(l): """ The standard deviation is a measure of the degree of dispersion of the data from the mean value. """ m = mean(l) n = len(l) s = 0 for k in l: s += (k - m) s /= (n-1) return sqrt(s) def mean(l): """ Calculate the mean value of the list l """ n = len(l) s = 0 for k in l: s += k return s/n def min_value(l): """ Return the min value of the list l """ return min(l) def max_value(l): """ Return the max value of the list l """ return max(l)