From 52ecfeea55a75bde9fd7035f0500b82d5e338093 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Mon, 27 Feb 2023 23:49:45 +0200 Subject: [PATCH] add missing formula calculation and remove excess formula --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a734bf5..16b6bb8 100644 --- a/main.py +++ b/main.py @@ -41,11 +41,14 @@ def process_table(file): table[1 + i*3 + k].append(round(preset_avg_a[i], r)) for i in table[1:]: - i.append(round(i[4]/(2*2*i[3]), r)) + i.append(round(i[4]/(2*i[3]), r)) i.append(round(i[10]/(9.8-i[10]), r)) w = max([max(list(map(lambda x: len(str(x)), i))) for i in table]) print("\n".join([" | ".join(list(map(lambda x: str(x).center(w), i))) for i in table])) + + miss_rate = round(abs(avg(list(zip(*table[1:]))[11]) - avg(list(zip(*table[1:]))[12])), r) + print(f"\nОбчислюємо похибку за формулою |❬A❭ - ❬B❭| = |{round(avg(list(zip(*table[1:]))[11]), r)} - {round(avg(list(zip(*table[1:]))[12]), r)}| = {miss_rate}") if len(sys.argv) == 2 and os.path.exists(sys.argv[1]): process_table(sys.argv[1])