(self, items=None, n=0.0, mean=0.0, sd=0.0)
RunningMean(items=None, n=0.0, mean=0.0, sd=0.0)

        Initializes the running mean calculator.

        There are two possible ways to initialize the calculator.
        First, one can provide an iterable of items; alternatively,
        one can specify the number of items, the mean and the
        standard deviation if we want to continue an interrupted
        calculation.

        @param items: the items that are used to initialize the
          running mean calcuator. If C{items} is given, C{n},
          C{mean} and C{sd} must be zeros.
        @param n: the initial number of elements already processed.
          If this is given, C{items} must be C{None}.
        @param mean: the initial mean. If this is given, C{items}
          must be C{None}.
        @param sd: the initial standard deviation. If this is given,
          C{items} must be C{None}.
RunningMean(items=None, n=0.0, mean=0.0, sd=0.0)
RunningMean ( items = None n = 0 . 0 mean = 0 . 0 sd = 0 . 0 )
def __init__(self, items=None, n=0.0, mean=0.0, sd=0.0):
        """RunningMean(items=None, n=0.0, mean=0.0, sd=0.0)

        Initializes the running mean calculator.

        There are two possible ways to initialize the calculator.
        First, one can provide an iterable of items; alternatively,
        one can specify the number of items, the mean and the
        standard deviation if we want to continue an interrupted
        calculation.

        @param items: the items that are used to initialize the
          running mean calcuator. If C{items} is given, C{n},
          C{mean} and C{sd} must be zeros.
        @param n: the initial number of elements already processed.
          If this is given, C{items} must be C{None}.
        @param mean: the initial mean. If this is given, C{items}
          must be C{None}.
        @param sd: the initial standard deviation. If this is given,
          C{items} must be C{None}."""
        if items is not None:
            if n != 0 or mean != 0 or sd != 0:
                raise ValueError("n, mean and sd must be zeros if items is not None")
            self.clear()
            self.add_many(items)
        else:
            self._nitems = float(n)
            self._mean = float(mean)
            if n > 1:
                self._sqdiff = float(sd) ** 2 * float(n - 1)
                self._sd = float(sd)
            else:
                self._sqdiff = 0.0
                self._sd = 0.0
def __init__ ( self , items = None , n = 0.0 , mean = 0.0 , sd = 0.0 ) : if items is not None : if n != 0 or mean != 0 or sd != 0 : raise ValueError ( "n, mean and sd must be zeros if items is not None" ) self . clear ( ) self . add_many ( items ) else : self . _nitems = float ( n ) self . _mean = float ( mean ) if n > 1 : self . _sqdiff = float ( sd ) ** 2 * float ( n - 1 ) self . _sd = float ( sd ) else : self . _sqdiff = 0.0 self . _sd = 0.0