def summary(aggregate):
    """
    Compute summary statistics from aggregation.
    """
    (airport, (count, total, square, minimum, maximum)) = aggregate

    try:
        mean   = total / float(count)
        stddev = math.sqrt((square-(total**2)/count)/count-1)

        return (airport, (count, mean, stddev, minimum, maximum))
    except Exception:
        return (airport, (count, None, None, minimum, maximum))

##########################################################################
## Primary Analysis and Main Method
##########################################################################
dataset/ETHPy150Open bbengfort/hadoop-fundamentals/describe/spark-app.py/summary/original