Skip to content

Instantly share code, notes, and snippets.

@antoinealb
Created April 3, 2013 16:40
Show Gist options
  • Save antoinealb/5302918 to your computer and use it in GitHub Desktop.
Save antoinealb/5302918 to your computer and use it in GitHub Desktop.
Serie 2 exo 3 de ProbaStat
data = list(map(float, """64.5
63.5
69.5
66.5
68.5
67.0
67.5
70.0
69.5
67.5
71.0
62.0
66.5
68.5
72.0
65.0
68.0
70.0
73.0
64.5""".split()))
def mean(m):
return sum(m)/len(m)
mu = mean(data)
res = [x - mu for x in data]
sct = sum([x**2 for x in data])
scr = sum([r**2 for r in res])
# dafuq ?
scf = len(data) * mu**2
print(scf)
print(sct+scr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment