python - 类型错误 : ttest_1samp() got an unexpected keyword argument 'alternative'

标签 python scipy

我不断收到此错误消息:

TypeError: ttest_1samp() got an unexpected keyword argument 'alternative'

我的代码是:

test_stat, p_value = ttest_1samp(FF['Time'], popmean=40, alternative='greater')
print('the p-value is', p_value)

最佳答案

更新 scipy 版本应该有帮助:

pip install --upgrade scipy

关于python - 类型错误 : ttest_1samp() got an unexpected keyword argument 'alternative' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67205843/

相关文章:

Python fsolve() 提示形状。为什么?

python - 将公式应用于 pandas 行/回归线

python - 在 Python 中插值 3d 数组。如何避免for循环?

python - 如何访问添加到类的方法中的 "__"(双下划线)变量

python - 如何使用缩进将 HTML 漂亮地打印到文件中

python - 在 Python 中,如何引用在生成器表达式中调用的函数的返回值?

python - 在不使用 scipy.interpolate.griddata 的情况下在 pyplot 中插入 NaN 值

python - scipy.signal.sepfir2d 中的类型错误

python - 如何理解卡方列联表

python - 在 Python 中使用对象作为列表索引