def estimateGaussian(data, unbiased=1):
    """Estimates a 1-d gaussian from `data` (a list of values) and returns ``(mean, variance)``."""
    l = float(len(data))
    mean = sum(data)/l
    var = sum([(d-mean)**2.0 for d in data])
    if unbiased:
        var /= l-1
    else:
        var /= l
    return mean, var