def first_hour_average(timeseries):
 last_hour_threshold = (time() - (FULL_DURATION - 3600))
 series = pandas.Series([x[1] for x in timeseries if (x[0] < last_hour_threshold)])
 mean = series.mean()
 stdDev = series.std()
 t = tail_avg(timeseries)
 return (abs((t - mean)) > (3 * stdDev))

def first_hour_average ( timeseries ) : last_hour_threshold = ( time ( ) - ( FULL_DURATION - 3600 ) ) series = pandas . Series ( [ x [ 1 ] for x in timeseries if ( x [ 0 ] < last_hour_threshold ) ] ) mean = series . mean ( ) stdDev = series . std ( ) t = tail_avg ( timeseries ) return ( abs ( ( t - mean ) ) > ( 3 * stdDev ) )
calcuate the simple average over one hour .