Commit 09f1350a authored by vrnnncl's avatar vrnnncl

initial commit

parents
from numpy import square, round, average, abs, var, sqrt, divide, multiply
d1 = [14.85, 14.80, 14.79, 14.84, 14.81]
d2 = [7.48, 7.49, 7.52, 7.47, 7.50]
d3 = [47.12, 47.08, 47.13]
d4 = [24.75, 24.90, 24.85, 25.05, 24.85]
def stat(lst):
avg = round(average(lst), 10)
difference = [round(lst_i - avg, 10) for lst_i in lst]
diff_sq = square(difference)
disp = round(var(lst), 10)
sqrt_disp = round(sqrt(disp), 10)
absolute = round(average(abs(difference)), 10)
relative = round(multiply(divide(absolute, avg), 100), 10)
print(f"{lst = }\n"
f"разность: {difference}\n"
f"квадратичная разность: {diff_sq}\n"
f"среднее: {avg}\n"
f"среднеквадратичная погрешность: {disp}\n"
f"стандартное отклонение: {sqrt_disp}\n"
f"абсолютная погрешность: {absolute}\n"
f"относительная погрешность: {relative}%\n")
if __name__ == "__main__":
stat(d4)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment