Check equality without null
propagation
Description
This considers that null values are equal. It differs from
$eq()
where null values are propagated.
Usage
<Expr>$eq_missing(other)
Arguments
other
|
A literal or expression value to compare with. |
Value
A polars expression
See Also
expr__eq
Examples
library("polars")
df <- pl$DataFrame(x = c(NA, FALSE, TRUE), y = c(TRUE, TRUE, TRUE))
df$with_columns(
eq = pl$col("x")$eq("y"),
eq_missing = pl$col("x")$eq_missing("y")
)
#> shape: (3, 4)
#> ┌───────┬──────┬───────┬────────────┐
#> │ x ┆ y ┆ eq ┆ eq_missing │
#> │ --- ┆ --- ┆ --- ┆ --- │
#> │ bool ┆ bool ┆ bool ┆ bool │
#> ╞═══════╪══════╪═══════╪════════════╡
#> │ null ┆ true ┆ null ┆ false │
#> │ false ┆ true ┆ false ┆ false │
#> │ true ┆ true ┆ false ┆ false │
#> └───────┴──────┴───────┴────────────┘