Skip to content

partial_sums

Syntax

partial_sums(value-list)

Parameters

value-list
A list-valued expression.

Returns

Returns a list of values of the partial sums of the values in the argument list.

Description

This action returns the list of partial sums of the values in the list. That is, each value in the resulting list consists of the sum of all items up to an including the current element in the list.

Examples

x_list = list(1, 2, 3, 4)
y_list = partial_sums(x_list)
# y_list has value (1, 3, 6, 10)

See Also