The KS calculation in the loop was getting a "too deep" error because I needed to pass it a 1-D array for each distribution to test:for idx, row in df.iterrows(): df.loc[idx, 'ks'] = stats.ks_2samp(df.loc[idx, grp1], (df.loc[idx, grp2]))[0]我之前的尝试使用了二维数组.这就是导致它太深"的原因My previous attempt used a 2-D array instead. That is what was causing it to be "too deep" 这篇关于对按行选择的 Pandas 列执行 scipy.stats 测试时出现 ValueError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-14 10:56