1

我正在使用 scipy 的统计数据来计算 Fisher 的精确测试分数。它工作得非常好,除了一些矩阵,它返回 valueError。例如,

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

返回

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

我不知道为什么这不应该工作..

有人可以帮我吗?

4

1 回答 1

1

这是fisher_exact函数中的一个错误。我在这里报告了这个问题:https ://github.com/scipy/scipy/issues/3014

于 2013-10-23T18:52:43.060 回答