daft.Expression.str.length#
- Expression.str.length() Expression [source]#
Retrieves the length for a UTF-8 string column
Example
>>> import daft >>> df = daft.from_pydict({"x": ["foo", "bar", "baz"]}) >>> df = df.select(df["x"].str.length()) >>> df.show() ╭────────╮ │ x │ │ --- │ │ UInt64 │ ╞════════╡ │ 3 │ ├╌╌╌╌╌╌╌╌┤ │ 3 │ ├╌╌╌╌╌╌╌╌┤ │ 3 │ ╰────────╯ (Showing first 3 of 3 rows)
- Returns:
an UInt64 expression with the length of each string
- Return type:
Expression