0

I want to use polars.Expr.apply to perform an operation on a Polars DataFrame column. I need to send additional argument. How do I send it?

4
  • 1
    Can you give more information? apply is slower, maybe it can be done in the native API. If you really need to use apply, functools.partial is probably the way to go as far as adding additional arguments. Commented Oct 13, 2023 at 1:31
  • Essentially you want to put the columns in a struct then you write your function or lambda expression to extract the underlying columns from within the struct. Something like this Commented Oct 13, 2023 at 10:51
  • or like this Commented Oct 13, 2023 at 10:53
  • or another Commented Oct 13, 2023 at 10:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.