best cumulative sum

David Isaac aisaac0 at verizon.net
Mon Nov 21 22:16:56 CET 2005


"Alan Isaac" <aisaac0 at verizon.net> wrote in message
news:Mzpgf.12794$NN2.4089 at trnddc02...
>             cr[0] = func(cr[0],init)

Ooops.  That assumed commutativity.
It shd be:
cr[0] = func(init,cr[0])
or perhaps for clarity
cr[0] = func(init,seq[0])

Alan Isaac





More information about the Python-list mailing list