Kyle
09/25/2024, 2:08 AMjay
09/25/2024, 4:01 AMdf = df.with_column(
"mapped",
df["list_of_strings"].list.eval(daft.element().str.left())
)
What about this API?Kyle
09/25/2024, 4:06 AMjay
09/25/2024, 4:08 AMstr.left() is not possible since str isn’t a type we control…
Another possible approach is maybe a lambda:
.list.apply(lambda item: item.str.left())
I’m afraid this gets a little confused with our current .apply which is a convenience method over UDFs thoughKyle
09/25/2024, 4:18 AMjay
09/25/2024, 4:18 AMstr in Python is just…. Python str so it wouldn’t work 😢Kyle
09/25/2024, 4:18 AMjay
09/25/2024, 4:18 AMjay
09/25/2024, 4:19 AMjay
09/25/2024, 4:19 AMKyle
09/25/2024, 4:19 AMKyle
09/25/2024, 4:19 AMjay
09/25/2024, 4:19 AM.list.applyKyle
09/25/2024, 4:19 AM