ray.data.expressions.LiteralExpr.str#
- property LiteralExpr.str: _StringNamespace#
Access string operations for this expression.
- Returns:
A _StringNamespace that provides string-specific operations.
Example
>>> from ray.data.expressions import col >>> import ray >>> ds = ray.data.from_items([ ... {"name": "Alice"}, ... {"name": "Bob"} ... ]) >>> ds = ds.with_column("upper_name", col("name").str.upper()) >>> ds = ds.with_column("name_len", col("name").str.len()) >>> ds = ds.with_column("starts_a", col("name").str.starts_with("A"))