On May 3, 9:50 am, Szabolcs Horvát <[EMAIL PROTECTED]> wrote: > I did the following calculation: Generated a list of a million random > numbers between 0 and 1, constructed a new list by subtracting the mean > value from each number, and then calculated the mean again. > > The result should be 0, but of course it will differ from 0 slightly > because of rounding errors.
See: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393090 > Here's the program (pardon my style, I'm a newbie/occasional user): . . . > mean = sum(data)/len(data) > print sum(x - mean for x in data)/len(data) See: http://svn.python.org/view/sandbox/trunk/statistics/statistics.py?rev=40981&view=markup Raymond -- http://mail.python.org/mailman/listinfo/python-list