Last active
July 19, 2018 12:27
-
-
Save jtemporal/8a28c192f7ccb739bd3455d37cc3995e to your computer and use it in GitHub Desktop.
Lesson 13: Variability - Quiz 32: SD social networkers
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
import math | |
# data (dados) | |
x = [38946, 43420, 49191, 50430, 50557, 52580, 53595, 54135, 60181, 62076] | |
# mean (média) | |
mean = sum(x)/len(x) | |
# Deviation from the mean (desvio da média) | |
desv = [number - mean for number in x] | |
# Average deviation from the mean (desvio médio) | |
avg_desv = sum(desv)/len(x) | |
# Sum of squares (soma dos quadrados) | |
ss = sum([math.pow((number - mean), 2) for number in x]) | |
# Variance (variância) | |
var = ss/len(x) | |
# Standard deviation (desvio padrão) | |
sigma = math.sqrt(var) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment