Answers for "python calculate variance by hand"

0

python calculate variance by hand

# calculate mean
m = sum(results) / len(results)

# calculate variance using a list comprehension
var_res = sum((xi - m) ** 2 for xi in results) / len(results)
Posted by: Guest on February-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language