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])