

def std_deviation(array):
    ' Compute the standard deviation of an array of numbers '
    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:
        variance = list(variance)
    stdev = AGGREGATES['mean_arithmetic'](variance)
    return math.sqrt(stdev)

dataset/ETHPy150Open svanoort/pyresttest/pyresttest/benchmarks.py std_deviation/original