Here's my function: a=lambda d:(sum((x-1.*sum(d)/len(d))**2 for x in d)/(1.*(len(d)-1)))**.5 The functions is invoked as follows: >>> a([1,2,3,4]) 1.2909944487358056 -- http://mail.python.org/mailman/listinfo/python-list
I'm trying to shorten a one-liner I have for calculating the standard
deviation of a list of numbers. I have something so far, but I was
wondering if it could be made any shorter (without imports).
- Standard Deviation One-liner Billy Mays
- Re: Standard Deviation One-liner Alain Ketterlin
- Re: Standard Deviation One-liner Alain Ketterlin
- Re: Standard Deviation One-liner Raymond Hettinger
- Re: Standard Deviation One-liner Steven D'Aprano
- Re: Standard Deviation One-liner Ethan Furman