標準偏差の計算

2015/8/10

Python2.7.6

import math

def calc_sd(number_list):
    n = len(number_list)
    m = float(sum(number_list)) / n
    s1 = 0.0
    for x in number_list:
        a = x - m
        s1 += a * a
    s1 = math.sqrt(s1 / n)
    return s1


統計学の基礎
http://www.geocities.jp/m_hiroi/light/pystat01.html