Pyspark: pass multiple columns in pandas_udf

Viewed 173

My problem is similar to this one but instead of udf I need to use pandas_udf.

I have a spark data frame with many columns (number of columns varies) and I need to apply on them a custom function (for example sum). I know I can hard-code column names but it does not work when the number of columns varies.

Please see examples:

enter image description here

0 Answers
Related