2024-04-19 20:26:44 发布
网友
我想在阵列(3d)的轴0上计算gamma拟合。我试过下面的代码,但有点不对劲。你知道吗
import scipy.stats as st import numpy as np myarray = np.random.rand(20, 3, 3) a, myloc, myscale = st.gamma.fit(myarray, axis=0)
fit方法不接受axis参数。你知道吗
fit
axis
实际上,在scipy0.15.1(可能还有更老的版本)中,它确实“接受”了它,但忽略了它。这看起来像个虫子。当您给它提供任何它实际上没有使用的参数时,它应该引发一个TypeError,但它当前不是这样工作的:
TypeError
In [20]: from scipy.stats import gamma In [21]: gamma.fit([1,2,3,3,3,4,5,7]) Out[21]: (3.6899039741659925, 0.049374155400321737, 0.93515411814698823) In [22]: gamma.fit([1,2,3,3,3,4,5,7], axis=123) Out[22]: (3.6899039741659925, 0.049374155400321737, 0.93515411814698823) In [23]: gamma.fit([1,2,3,3,3,4,5,7], flibbity=123) Out[23]: (3.6899039741659925, 0.049374155400321737, 0.93515411814698823)
错误报告:https://github.com/scipy/scipy/issues/4932
它应该是scipy.stats,而不是scipy.stat。你知道吗
scipy.stats
scipy.stat
fit
方法不接受axis
参数。你知道吗实际上,在scipy0.15.1(可能还有更老的版本)中,它确实“接受”了它,但忽略了它。这看起来像个虫子。当您给它提供任何它实际上没有使用的参数时,它应该引发一个
TypeError
,但它当前不是这样工作的:错误报告:https://github.com/scipy/scipy/issues/4932
它应该是
scipy.stats
,而不是scipy.stat
。你知道吗相关问题 更多 >
编程相关推荐