NetworkX

Previous topic

make_str

Next topic

generate_unique_node

cumulative_sum

cumulative_sum(numbers)[source]

Yield cumulative sum of numbers.

>>> import networkx.utils as utils
>>> list(utils.cumulative_sum([1,2,3,4]))
[1, 3, 6, 10]