scipy.stats导入错误:无法导入名称“alexandergovernor”

hivapdat  于 2022-11-10  发布在  Go
关注(0)|答案(1)|浏览(94)

我试着应用Scipy的 Alexandria ·戈文测试:

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'
f87krz0w

f87krz0w1#

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

相关问题