Created
September 9, 2014 21:22
-
-
Save erikerlandson/b82e2c5aa96fdfb90484 to your computer and use it in GitHub Desktop.
A python widget to do a Kolmogorov Smirnov test against two data sets
This file contains hidden or 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
import sys | |
import argparse | |
from scipy import stats | |
argparser = argparse.ArgumentParser() | |
argparser.add_argument('data1', type=argparse.FileType('r'), metavar='<data-file-1>') | |
argparser.add_argument('data2', type=argparse.FileType('r'), metavar='<data-file-2>') | |
args = argparser.parse_args() | |
dv1 = args.data1.read().split() | |
dv2 = args.data2.read().split() | |
ksres = stats.ks_2samp(dv1, dv2) | |
sys.stdout.write("KS test results: stat=%s pval=%s\n" % ksres) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment