Skip to content

Sum

fast step  math

Calculate the row-wise sum of numeric columns.

An additional constant may be used to add to the final result.

Usage


The following are the step's expected inputs and outputs and their specific types.

Step signature
sum(*columns: number, {
    "param": value
}) -> (result: number)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

Example

To add columns num1 and num2:

Example call (in recipe editor)
sum(ds.num1, ds.num2) -> (ds.total)
More examples

To add the constant 3.141 to column num1:

Example call (in recipe editor)
sum(ds.num1, {"constant": 3.141}) -> (ds.num1_plus_pi)

Inputs


*columns: column:number

One or numeric columns to sum.

Outputs


result: column:number

Numeric column containing the result of the summation.

Parameters


constant: number

A constant to add.


ignore_nans: boolean = False

Whether to ignore NaNs or propagate them.