For example, to multiply column A by two and add column Col B, you would simply write

calculate(ds[["A", "Col B"]], {
    "formula": "2 * A - `Col B`"
}) -> (ds.result)

For more details regarding valids operators etc. see the Pandas eval() documentation, more specifically the supported syntax, and eval() applied to DataFrames.

Note that assignments in the formula are not supported, since the result must always be a new column, i.e. the following kind of formula should be avoided: "c = a + b". The correct way to return the result as a column would simply be "a + b".

If the name of an input column contains spaces, such as in the example above, it should be quoted in single backticks.

formula
string
required

The formula to execute. A formula containing basic arithmetic operations and references to column names.

constants
object

Constants to be used in the formula. An object of key-value pairs, where keys refer to names of constants whose values will be available in the formula with a @ prefix. E.g. "constants": {"factor": 1.23} makes it possible to refer to @factor in the formula with given value; also see example(s).