Last active
September 14, 2017 22:04
-
-
Save derekpowell/b8b67e4f225abbcb7993603d30f88bd5 to your computer and use it in GitHub Desktop.
Python: stat_summary - function for statistical summary printout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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