ray.data.expressions.ColumnExpr#

class ray.data.expressions.ColumnExpr(_name: str)[source]#

Bases: Expr

Expression that references a column by name.

This expression type represents a reference to an existing column in the dataset. When evaluated, it returns the values from the specified column.

Parameters:

name – The name of the column to reference

Example

>>> from ray.data.expressions import col
>>> # Reference the "age" column
>>> age_expr = col("age") # Creates ColumnExpr(name="age")

DeveloperAPI: This API may change across minor Ray releases.

Methods

alias

Rename the expression.

is_in

Check if the expression value is in a list of values.

is_not_null

Check if the expression value is not null.

is_null

Check if the expression value is null.

not_in

Check if the expression value is not in a list of values.

to_pyarrow

Convert this Ray Data expression to a PyArrow compute expression.

Attributes

list

Access list operations for this expression.

name

Get the column name.

str

Access string operations for this expression.

struct

Access struct operations for this expression.

data_type