On Wed, 16 Apr 2014, Funmilayo Eniola Kazeem wrote:
Is there a command for cumulative sum in SAGE? If yes, what is it? If not,
how do I do it?
somenumbers=[1, 1.4142, 1.7321, 2]
[sum(somenumbers[0:i]) for i in range(1, len(somenumbers)+1)]
Of course not optimal, but easy if speed is not an issue. I don't know if
this if fast with %cython or not.
--
Jori Mäntysalo
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.