mathtools.cumulative_sums

abjad.tools.mathtools.cumulative_sums.cumulative_sums(sequence)[source]

Cumulative sums of sequence:

abjad> from abjad.tools import mathtools
abjad> mathtools.cumulative_sums([1, 2, 3, 4, 5, 6, 7, 8])
[1, 3, 6, 10, 15, 21, 28, 36]

Raise type error when sequence is neither list nor tuple.

Raise value error on empty sequence.

Return list.

Changed in version 2.0: renamed sequencetools.cumulative_sums() to mathtools.cumulative_sums().

This Page