Paul Rubin wrote: > "SpreadTooThin" <[EMAIL PROTECTED]> writes: > > print a.mean() > > print a.std_dev() > > > > Is there a way to calculate the mean and standard deviation on array data? > > Well, you could use numpy or whatever. If you want to calculate directly, > you could do something like (untested): > > n = len(a) > mean = sum(a) / n > sd = sqrt(sum((x-mean)**2 for x in a) / n)
This last line looks like it will be very slow... Escpecially if the array is large... So speed is the real issue here... If there is a faster way... like transferring the array to a different container class... but what? -- http://mail.python.org/mailman/listinfo/python-list