Jump to content

Cumulative standard deviation: Difference between revisions

Line 2,722:
===Python: In a couple of 'functional' lines===
<lang python>>>> myMean = lambda MyList : reduce(lambda x, y: x + y, MyList) / float(len(MyList))
>>> myStd = lambda myListMyList : (reduce(lambda x,y : x + y , map(lambda x: (x-myMean(MyList))**2 , MyList)) / float(len(MyList)))**.5
 
>>> print myStd([2,4,4,4,5,5,7,9])
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.