Let’s see how to calculate floating-point arithmetic mean in Python using a fmean method.
Using a fmean method
To calculate floating-point arithmetic average we need to import statistics module.
Luckily, there is a dedicated function in statistics module to calculate a floating-point arithmetic mean.
import statistics as s x = [1, 5, 7, 8, 43, 6] fmean = s.fmean(x) print("Floating-point arithmetic mean equals: " + str(round(fmean, 2)))