ray.data.expressions.UnaryExpr#
- class ray.data.expressions.UnaryExpr(op: Operation, operand: Expr)[source]#
Bases:
ExprExpression that represents a unary operation on a single expression.
This expression type represents an operation with one operand. Common unary operations include logical NOT, IS NULL, IS NOT NULL, etc.
- Parameters:
op – The operation to perform (from Operation enum)
operand – The operand expression
Example
>>> from ray.data.expressions import col >>> # Check if a column is null >>> expr = col("age").is_null() # Creates UnaryExpr(IS_NULL, col("age")) >>> # Logical not >>> expr = ~(col("active")) # Creates UnaryExpr(NOT, col("active"))
DeveloperAPI: This API may change across minor Ray releases.
Methods
Compute the absolute value of the expression.
Rename the expression.
Round values up to the nearest integer.
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.
Convert this Ray Data expression to a PyArrow compute expression.
Truncate fractional values toward zero.
Attributes
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.