gpt4 book ai didi

python scipy 统计模块 : ValueError: 'axis' entry is out of bounds

转载 作者:太空宇宙 更新时间:2023-11-03 18:45:50 25 4
gpt4 key购买 nike

我正在使用 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

我不知道为什么这不起作用..

有人可以帮我吗?

最佳答案

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

关于python scipy 统计模块 : ValueError: 'axis' entry is out of bounds,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19548854/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com