code: def mean(data, n=3, **kwargs):
      
      # don't start averaging until we've seen n points
      if len(data[-n:]) < n:
          forecast = np.nan
      else:
          # nb: we'll keep the forecast as a float
          forecast = np.mean(data[-n:])
      return forecast
docs: The mean forecast for the next point is the mean value of the previous ``n`` points in 
      the series.
  
      Args:
          data (np.array): Observed data, presumed to be ordered in time.
          n (int): period over which to calculate the mean 
  
      Returns:
          float: a single-valued forecast for the next value in the series.