def stddev_from_average(timeseries):
 series = pandas.Series([x[1] for x in timeseries])
 mean = series.mean()
 stdDev = series.std()
 t = tail_avg(timeseries)
 return (abs((t - mean)) > (3 * stdDev))

def stddev_from_average ( timeseries ) : series = pandas . Series ( [ x [ 1 ] for x in timeseries ] ) mean = series . mean ( ) stdDev = series . std ( ) t = tail_avg ( timeseries ) return ( abs ( ( t - mean ) ) > ( 3 * stdDev ) )
a timeseries is anomalous if the absolute value of the average of the latest three datapoint minus the moving average is greater than three standard deviations of the average .