【发布时间】:2013-11-21 15:35:56
【问题描述】:
如何在 python 的 if else 语句中实现统计测试?我正在使用 scipy 统计信息。我想要实现的代码的一小部分是:
def choose():
global sample
if q1.get() == 1 and q2.get() == 1 and q3.get() == 2 and q4.get() == 2 and q5.get() == 1 and q6.get() == 2 and q7.get() == 2 and q8.get() == 2 and q9.get() == 2 :
tkMessageBox.showinfo( 'decision', 'You should use the t-test!')
stats.ttest_1samp()
#will do t-test here
print sample
# now sample list contains the data for doing t-test,
#you just need to call t-test to get the results and show it on message box
【问题讨论】:
标签: python if-statement statistics scipy