我运行的每个 t 测试都输出 nan 的统计量和 p 值我检查了我的数据框,它们看起来很好。有谁知道发生了什么?提前致谢!
e_tr.groupby('Rest Periods')['Wages and Hours'].mean()
#t test
cat1 = e_tr[e_tr['Rest Periods']==0]
cat2 = e_tr[e_tr['Rest Periods']==1]
# cat1['Wages and Hours'].value_counts()
sp.stats.ttest_ind(cat1.dropna()['Rest Periods'], cat2.dropna()['Rest Periods'])
ttest_ind(cat1['Wages and Hours'], cat2['Wages and Hours'])
输出:Ttest_indResult(statistic=nan, pvalue=nan)