ramravi
Contributor II

pandas_udf are optimized and faster for grouped operations, like applying a pandas_udf after a groupBy. The grouping allows pandas to perform vectorized operations and will be faster than normal udf. for normal case like a*b, a normal spark udf will suffice and be faster.

https://bryancutler.github.io/vectorizedUDFs/