Skip to content

Instantly share code, notes, and snippets.

Created May 3, 2012
What would you like to do?
Random stats functions
def mean(x): return sum(x) / len(x)
def std_dev(x, mx=None):
if mx is None:
mx = mean(x)
return math.sqrt(sum((i - mx)**2 for i in x)/len(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment