Operators#

Polars supports native Python operators for all common operations; these operators are also available as methods on the Expr class.

Conjunction#

Expr.and_(*others)

Method equivalent of bitwise "and" operator expr & other & ....

Expr.or_(*others)

Method equivalent of bitwise "or" operator expr | other | ....

Comparison#

Expr.eq(other)

Method equivalent of equality operator expr == other.

Expr.eq_missing(other)

Method equivalent of equality operator expr == other where None == None.

Expr.ge(other)

Method equivalent of "greater than or equal" operator expr >= other.

Expr.gt(other)

Method equivalent of "greater than" operator expr > other.

Expr.le(other)

Method equivalent of "less than or equal" operator expr <= other.

Expr.lt(other)

Method equivalent of "less than" operator expr < other.

Expr.ne(other)

Method equivalent of inequality operator expr != other.

Expr.ne_missing(other)

Method equivalent of equality operator expr != other where None == None.

Numeric#

Expr.add(other)

Method equivalent of addition operator expr + other.

Expr.floordiv(other)

Method equivalent of integer division operator expr // other.

Expr.mod(other)

Method equivalent of modulus operator expr % other.

Expr.mul(other)

Method equivalent of multiplication operator expr * other.

Expr.sub(other)

Method equivalent of subtraction operator expr - other.

Expr.truediv(other)

Method equivalent of float division operator expr / other.

Expr.pow(exponent)

Method equivalent of exponentiation operator expr ** exponent.

Binary#

Expr.xor(other)

Method equivalent of bitwise exclusive-or operator expr ^ other.