Created
May 13, 2012 21:05
-
-
Save jrovegno/2690196 to your computer and use it in GitHub Desktop.
standard deviation of the values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
sum, sum2, n = 0.0, 0.0, 0.0 | |
with open("numeros.txt") as infile: | |
for line in infile: | |
k = float(line) | |
sum += k | |
sum2 += k*k | |
n += 1 | |
print sqrt(sum2/n - (sum/n)**2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment