>>> const df = pl.DataFrame(
... {
... "a": [1, 8, 3],
... "b": [4, 5, null],
... "c": ["x", "y", "z"],
... }
... )
>>> df.withColumns(pl.sumHorizontal(pl.col("a"), ol.col("b")))
shape: (3, 4)
┌─────┬──────┬─────┬──────┐
│ a ┆ b ┆ c ┆ sum │
│ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ str ┆ i64 │
╞═════╪══════╪═════╪══════╡
│ 1 ┆ 4 ┆ x ┆ 5 │
│ 8 ┆ 5 ┆ y ┆ 13 │
│ 3 ┆ null ┆ z ┆ null │
└─────┴──────┴─────┴──────┘
Sum all values horizontally across columns.