| 1 | initial version |
This can be done via Python's itertools.accumulate function:
import itertools
h = itertools.accumulate(g, initial=0)
| 2 | No.2 Revision |
This can be done via Python's itertools.accumulate function:
import itertools
h = list( itertools.accumulate(g, initial=0)
initial=0) )
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.