[Python-Dev] Accumulation module

Raymond Hettinger python at rcn.com
Thu Feb 26 20:04:23 EST 2004


> > * Is there a way to compute the standard deviation without multiple
> > passes over the data (one to compute the mean and a second to sum
the
> > squares of the differences from the mean?
> >
> >
> 
> I do not understand the problem in getting stdev in a single pass.
> Perhaps I not understood your problem. If you have a series of values
> you merely have to calculate their sum and sum-of-squares and use the
> usual formula.

The sandbox contains the latest and greatest version which computes the
standard deviation in a single pass using a recurrence formula that has
much better numerical performance than the textbook approach.


Raymond Hettinger




More information about the Python-Dev mailing list