best cumulative sum

bonono at gmail.com bonono at gmail.com
Mon Nov 21 02:02:43 EST 2005


Erik Max Francis wrote:
> Micah Elliott wrote:
>
> > On Nov 21, David Isaac wrote:
>  >
> >> What's the good way to produce a cumulative sum?
> >
> >>>> import operator
> >>>> x = 1,2,3
> >>>> reduce(operator.add, x)
> > 6
> 
> Or just sum(x).
> 
He seems to want scanl




More information about the Python-list mailing list