[Scipy-svn] r6943 - trunk/scipy/stats

scipy-svn@scip... scipy-svn@scip...
Thu Nov 25 04:14:58 CST 2010


Author: ptvirtan
Date: 2010-11-25 04:14:54 -0600 (Thu, 25 Nov 2010)
New Revision: 6943

Modified:
   trunk/scipy/stats/stats.py
Log:
BUG: stats: fix integer division issues in fisher_exact

Modified: trunk/scipy/stats/stats.py
===================================================================
--- trunk/scipy/stats/stats.py	2010-11-25 08:31:43 UTC (rev 6942)
+++ trunk/scipy/stats/stats.py	2010-11-25 10:14:54 UTC (rev 6943)
@@ -2442,7 +2442,7 @@
             if maxval == minval + 1 and guess == minval:
                 guess = maxval
             else:
-                guess = (maxval + minval) / 2
+                guess = (maxval + minval) // 2
 
             pguess = hypergeom.pmf(guess, n1 + n2, n1, n)
             if pguess <= pexact and hypergeom.pmf(guess - 1, n1 + n2, n1, n) > pexact:
@@ -2478,7 +2478,7 @@
             if maxval == minval + 1 and guess == minval:
                 guess = maxval
             else:
-                guess = (maxval + minval) / 2
+                guess = (maxval + minval) // 2
             pguess = hypergeom.pmf(guess, n1 + n2, n1, n)
             if pguess <= pexact and hypergeom.pmf(guess + 1, n1 + n2, n1, n) > pexact:
                 break



More information about the Scipy-svn mailing list