Skip to content

Instantly share code, notes, and snippets.

@derekpowell
Last active September 14, 2017 22:04
Show Gist options
  • Save derekpowell/b8b67e4f225abbcb7993603d30f88bd5 to your computer and use it in GitHub Desktop.
Save derekpowell/b8b67e4f225abbcb7993603d30f88bd5 to your computer and use it in GitHub Desktop.
Python: stat_summary - function for statistical summary printout
def stat_summary(x, quantiles=False):
import numpy as np
print "mean:", np.mean(x)
print "sd:", np.std(x)
print "max:", np.max(x)
print "min:", np.min(x)
print "count:", len(x)
if quantiles==True:
print "-----------------------------------------"
for p in range(10,100,10):
print p, "percentile:", np.percentile(x,p)
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment