# HG changeset patch # User Nicolas Saunier # Date 1489010729 18000 # Node ID c7e72d7580499253099dc30a85ce9295dd1870d5 # Parent 45384b45e35a2f389d32c4510136c556ad43f8cb minor update to avoid integer issue diff -r 45384b45e35a -r c7e72d758049 python/utils.py --- a/python/utils.py Wed Feb 15 14:59:57 2017 -0500 +++ b/python/utils.py Wed Mar 08 17:05:29 2017 -0500 @@ -82,10 +82,7 @@ def computeChi2(expected, observed): '''Returns the Chi2 statistics''' - result = 0. - for e, o in zip(expected, observed): - result += ((e-o)*(e-o))/e - return result + return sum([((e-o)*(e-o))/float(e) for e, o in zip(expected, observed)]) class DistributionSample(object): def nSamples(self):