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.
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
applyis slower, maybe it can be done in the native API. If you really need to useapply,functools.partialis probably the way to go as far as adding additional arguments.