>>> const df = pl.DataFrame(
... {
... "a": [1, 8, 3],
... "b": [4, 5, null],
... "c": ["x", "y", "z"],
... }
... )
>>> df.withColumns(pl.minHorizontal(pl.col("a"), pl.col("b")))
shape: (3, 4)
┌─────┬──────┬─────┬─────┐
│ a ┆ b ┆ c ┆ min │
│ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ str ┆ i64 │
╞═════╪══════╪═════╪═════╡
│ 1 ┆ 4 ┆ x ┆ 1 │
│ 8 ┆ 5 ┆ y ┆ 5 │
│ 3 ┆ null ┆ z ┆ 3 │
└─────┴──────┴─────┴─────┘
Get the minimum value horizontally across columns.