scipy.stats 导入错误:无法导入名称'alexandergovern'



我正在尝试应用scipy的Alexander Govern测试:

import pandas as pd
import scipy.stats

df1 = pd.read_csv(r'Data1.tsv', sep='t', encoding='utf-8')
df2 = pd.read_csv(r'Data2.tsv', sep='t', encoding='utf-8')
from scipy.stats import alexandergovern
alexandergovernTest = alexandergovern(df1.iloc[2:,:135], df2.iloc[2:,:134])
print(alexandergovernTest)

我得到以下错误:

Traceback (most recent call last):
File "calculate_onewayANOVA.py", line 41, in <module>
from scipy.stats import alexandergovern
ImportError: cannot import name 'alexandergovern'

此错误在Ubuntu 20升级到python3.8并安装scipy==1.7.3后解决,如@Nelewout和@WarrenWeckesser所示

相关内容

  • 没有找到相关文章

最新更新