1

I'm using scipy's stats to calculate Fisher's Exact Test score.. It works perfectly fine, except for some matrices, it returns valueError. For example,

odds, pvalue = stats.fisher_exact([[1,2],[9,84419233]])

returns

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/scipy-0.14.0.dev_4938da3-py2.7-macosx-10.8-x86_64.egg/scipy/stats/stats.py", line 2606, in fisher_exact
    if float(np.abs(pexact - pmode)) / np.abs(np.max(pexact, pmode)) <= 1 - epsilon:
  File "/Library/Python/2.7/site-packages/numpy-1.9.0.dev_fde3dee-py2.7-macosx-10.8-x86_64.egg/numpy/core/fromnumeric.py", line 2126, in amax
    return amax(axis=axis, out=out)
  File "/Library/Python/2.7/site-packages/numpy-1.9.0.dev_fde3dee-py2.7-macosx-10.8-x86_64.egg/numpy/core/_methods.py", line 17, in _amax
    out=out, keepdims=keepdims)
ValueError: 'axis' entry is out of bounds

I have no idea why this shouldn't work..

Could someone please help me out?

1
  • This looks like a bug in fisher_exact. Commented Oct 23, 2013 at 18:11

1 Answer 1

1

This is a bug in the fisher_exact function. I've reported the problem here: https://github.com/scipy/scipy/issues/3014

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.