Function anyHorizontal

  • Compute the bitwise OR horizontally across columns.

    Parameters

    • exprs: ExprOrString | ExprOrString[]

    Returns pl.Expr

     >>> const df = pl.DataFrame(
    ... {
    ... "a": [false, false, true, null],
    ... "b": [false, true, null, null],
    ... "c": ["w", "x", "y", "z"],
    ... }
    ... )
    >>> df.withColumns(pl.anyHorizontal([pl.col("a"), pl.col("b")]))
    shape: (4, 4)
    ┌───────┬───────┬─────┬───────┐
    abcany
    │ --- ┆ --- ┆ --- ┆ --- │
    boolboolstrbool
    ╞═══════╪═══════╪═════╪═══════╡
    falsefalsewfalse
    falsetruextrue
    truenullytrue
    nullnullznull
    └───────┴───────┴─────┴───────┘