ray.data.expressions.BinaryExpr#
- class ray.data.expressions.BinaryExpr(op: Operation, left: Expr, right: Expr)[source]#
Bases:
ExprExpression that represents a binary operation between two expressions.
This expression type represents an operation with two operands (left and right). The operation is specified by the
opfield, which must be one of the supported operations from the Operation enum.- Parameters:
op – The operation to perform (from Operation enum)
left – The left operand expression
right – The right operand expression
Example
>>> from ray.data.expressions import col, lit, Operation >>> # Manually create a binary expression (usually done via operators) >>> expr = BinaryExpr(Operation.ADD, col("x"), lit(5)) >>> # This is equivalent to: col("x") + lit(5)
DeveloperAPI: This API may change across minor Ray releases.
Methods
Compute the absolute value of the expression.
Compute the arccosine (inverse cosine) of the expression, returning radians.
Rename the expression.
Compute the arcsine (inverse sine) of the expression, returning radians.
Compute the arctangent (inverse tangent) of the expression, returning radians.
Round values up to the nearest integer.
Compute the cosine of the expression (in radians).
Compute the natural exponential of the expression.
Round values down to the nearest integer.
Check if the expression value is in a list of values.
Check if the expression value is not null.
Check if the expression value is null.
Compute the natural logarithm of the expression.
Compute the base-10 logarithm of the expression.
Compute the base-2 logarithm of the expression.
Compute the negation of the expression.
Check if the expression value is not in a list of values.
Raise the expression to the given power.
Round values to the nearest integer using PyArrow semantics.
Compute the sign of the expression.
Compute the sine of the expression (in radians).
Compute the tangent of the expression (in radians).
Convert this Ray Data expression to a PyArrow compute expression.
Truncate fractional values toward zero.
Attributes
Access array operations for this expression.
Access datetime operations for this expression.
Access list operations for this expression.
Get the name associated with this expression.
Access string operations for this expression.
Access struct operations for this expression.