code: def average(self, default=None):
          
          return numpy.asscalar(numpy.average(self.values)) if self.values else default
docs: Calculate the average value over the time series.
  
          :param default: Value to return as a default should the calculation not be possible.
          :return: Float representing the average value or `None`.