daft.Expression.str.capitalize#
- Expression.str.capitalize() Expression [source]#
Capitalize a UTF-8 string
Example
>>> import daft >>> df = daft.from_pydict({"x": ["foo", "bar", "baz"]}) >>> df = df.select(df["x"].str.capitalize()) >>> df.show() ╭──────╮ │ x │ │ --- │ │ Utf8 │ ╞══════╡ │ Foo │ ├╌╌╌╌╌╌┤ │ Bar │ ├╌╌╌╌╌╌┤ │ Baz │ ╰──────╯ (Showing first 3 of 3 rows)
- Returns:
a String expression which is
self
uppercased with the first character and lowercased the rest- Return type:
Expression