stats.TimeSeries has a very fast sums method - everything must be float
though.  Numpy also has something.
On Apr 16, 2014 2:33 AM, "Jori Mantysalo" <jori.mantys...@uta.fi> wrote:

> 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 sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to