Posted By

adkatrit on 02/11/11


Tagged

statistics variance


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

adkatrit


Variance


 / Published in: Python
 

  1. def variance(vals):
  2. mean=float(sum(vals))/len(vals)
  3. s=sum([v-mean)**2 for v in vals])
  4. return s/len(vals)

Report this snippet  

You need to login to post a comment.