我在下面有以下命令:
Townames = []
Notowns = []
def run_ttest():
for key,value in enumerate(data['RegionName']):
if value in stateslist:
indexing = data['differ'].iloc[key]
Townames.append(indexing)
else:
indexing = data['differ'].iloc[key]
Notowns.append(indexing)
Unitowns = pd.DataFrame(columns = ['Unitownvalues'])
Notunitowns = pd.DataFrame(columns = ['Notunitownvalues'])
Unitowns['Unitownvalues'] = Townames
Notunitowns['Notunitownvalues'] = Notowns
Unitowns = Unitowns.dropna(subset=['Unitownvalues'])
Notunitowns = Notunitowns.dropna(subset=['Notunitownvalues'])
return
run_ttest()
from scipy import stats
stats.ttest_ind(Unitowns['Unitownvalues'],Notunitowns['Notunitownvalues'])
但是,我的输出是:
Ttest_indResult(statistic=nan, pvalue=nan)
我不明白这是为什么。
我删除了上面的 NAN 值:Unitowns['Unitownvalues']和Notunitowns['Notunitownvalues'].
有人能帮帮我吗?
www说
相关分类