Daft
Daft copied to clipboard
Add a .list.apply() expression
Would apply a function on each element in the list
Example:
df = daft.from_pydict({"a": [["HeLLo WoRlD", "Hi", "WelCoMe"], ["tO", "a New WoRlD"]]})
df.with_column("b", col("a").list.apply(element().str.lower())).select("b").show()
Expected output:
╭─────────────╮
│ b │
│ --- │
│ List[Struct[value: Utf8, count: Int32]] │
╞═════════════╡
│ [["hello world", "hi", "welcome"]] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ ["to", "a new world"] │
╰─────────────╯
(Showing first 2 of 2 rows)