执行scipy.stats.Permutation_test真的存在吗?



scipy文档描述了一个模块[scipy.stats.permutation_test].1

当我尝试在Jupyter Notebook中使用此模块时,如下所示,我得到:

"AttributeError: module '。Stats '没有属性'permutation_test'"

查看scipy的所有属性。在Notebook中,没有列出permutation_test。permutation_test模块是否真的存在于sciy中,或者这是一个Anaconda分布问题?

import numpy as np
import scipy.stats as sps
def stat_q25(x, y):
return np.quantile(x, 0.25) - np.quantile(y, 0.25)
test_q25 = sps.permutation_test(data = (x, y), statistic = stat_q25, alternative = 'greater')

可能你的python版本太低了。如果您将其更新到更高版本,例如3.8,则可以安装更高版本的scipy, permutation_test将包含在内。

我有同样的问题,最近解决了。

最新更新