How can I calculate the variance of a list in python?
You can use numpy’s built-in function var: import numpy as np results = [-14.82381293, -0.29423447, -13.56067979, -1.6288903, -0.31632439, 0.53459687, -1.34069996, -1.61042692, -4.03220519, -0.24332097] print(np.var(results)) This gives you 28.822364260579157 If – for whatever reason – you cannot use numpy and/or you don’t want to use a built-in function for it, you can also calculate it “by … Read more