Bug in stats.fisher_exact #3014
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.stats
Milestone
A problem with stats.fisher_exact was reported on stackoverflow:
http://stackoverflow.com/questions/19548854/python-scipy-stats-module-valueerror-axis-entry-is-out-of-bounds
The culprit appears to be this line:
https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py#L2633
I assume that
np.max(pexact, pmode)
should benp.maximum(pexact, pmode)
.As it is now,
pmode
is being passed tonp.max()
as itsaxis
argument. Usuallypmode
is less than 1, so theaxis
value is truncated to 0 and an error is not generated. For the special case reported in the Stack Overflow question,stats.fisher_exact([[1,2],[9,84419233]])
,pmode
is 1.00000001738, so an error is raised.The text was updated successfully, but these errors were encountered: