From 94d458cf8052daa15e5cac443d155dfc2fcd1e64 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Mon, 7 Oct 2019 18:58:07 +0200 Subject: [PATCH] Output formatting --- scripts/welch_ttest.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/welch_ttest.py b/scripts/welch_ttest.py index ea6c657..eaea55f 100755 --- a/scripts/welch_ttest.py +++ b/scripts/welch_ttest.py @@ -29,9 +29,11 @@ print("Command 2: {}\n".format(b)) t, p = stats.ttest_ind(X, Y, equal_var=False) th = 0.05 dispose = p < th -print("t = {}, p = {}".format(t, p)) -print("p < {} = {}\n".format(th, dispose)) +print("t = {:.3}, p = {:.3}".format(t, p)) +print() + if dispose: - print("There is a difference between the two benchmarks.") + print("There is a difference between the " + "two benchmarks (p < {}).".format(th)) else: - print("The two benchmarks are almost the same.") + print("The two benchmarks are almost the same (p >= {}).".format(th))