错误原因:DataFrame对象没有reshape方法。

修改方法:需要将DataFrame对象转换为numpy数组,然后再进行reshape操作。

修改代码如下:

import numpy as np
from scipy import stats

X = np.array(df1['X'])
y = np.array(df2['Y'])

# 进行Mann-Whitney独立样本检验
X = X.reshape(-1)
statistic, p_value = stats.mannwhitneyu(X, y)
AttributeError Traceback most recent call lastCell In20 line 2 1 # 进行Mann-Whitney独立样本检验---- 2 Xreshape-1 3 statistic p_value = statsmannwhitneyuXyFile ~anaconda3li

原文地址: https://www.cveoy.top/t/topic/htmT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录