1
我使用scipy的統計信息來計算Fisher's Exact Test分數。 它工作得很好,除了一些矩陣,它返回valueError。 例如,python scipy stats module:ValueError:'axis'條目超出範圍
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
我不知道爲什麼這不應該工作..
可能有人請幫助我嗎?
這看起來像'fisher_exact'中的一個錯誤。 –