polars.Expr.bitwise_xor
-
Выполняет агрегацию побитовых операций XOR.
Примеры
>>> df = pl.DataFrame({"n": [-1, 0, 1]}) >>> df.select(pl.col("n").bitwise_xor()) shape: (1, 1) ┌─────┐ │ n │ │ --- │ │ i64 │ ╞═════╡ │ -2 │ └─────┘ >>> df = pl.DataFrame( ... {"grouper": ["a", "a", "a", "b", "b"], "n": [-1, 0, 1, -1, 1]} ... ) >>> df.group_by("grouper", maintain_order=True).agg(pl.col("n").bitwise_xor()) shape: (2, 2) ┌─────────┬─────┐ │ grouper ┆ n │ │ --- ┆ --- │ │ str ┆ i64 │ ╞═════════╪═════╡ │ a ┆ -2 │ │ b ┆ -2 │ └─────────┴─────┘
Expr.bitwise_xor() → Expr
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.bitwise_xor.html