add missing formula calculation and remove excess formula

This commit is contained in:
dymik739 2023-02-27 23:49:45 +02:00
parent 5581606afd
commit 52ecfeea55
1 changed files with 4 additions and 1 deletions

View File

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