2024-06-26 10:17:21 发布
网友
我有两个数据帧pd和pd2:
警察局
Name A B Mean t1 1.0 2.0 1.5 t2 2.0 3.0 2.5 t3 9.4 3.3 6.35
pd2型
我想对两个数据帧上的列“A”和两个数据帧上的列B执行ttest计算结果可以添加到其中一个数据帧中,也可以添加到新的数据帧中。输出应包含以下列:
ttestA ttestB ttestC ...etc
使用for循环
from scipy import stats l=[] listofname=['A','B'] for x in listofname: l.append(stats.ttest_ind(df[x],df2[x], equal_var=False))
使用for循环
相关问题 更多 >
编程相关推荐