def std_deviation(array):
    if not array or len(array) == 1:
        return 0

    average = AGGREGATES['mean_arithmetic'](array)
    variance = map(lambda x: (x - average)**2, array)
    try:
        len(variance)
    except TypeError:  # Python 3.3 workaround until can use the statistics module from 3.4
        variance = list(variance)
    stdev = AGGREGATES['mean_arithmetic'](variance)
    return math.sqrt(stdev)
Compute the standard deviation of an array of numbers
dataset/ETHPy150Open svanoort/pyresttest/pyresttest/benchmarks.py/std_deviation