import math


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))