Posts by Dee • 101 points
1 post
-
0
votes2
answers22
viewsA: how to create an udf using two columns and if expression
I don’t know if I understand the question correctly, I haven’t spoken Portuguese for a long time. That’s what you wanna do? df.withColumn('selection2', when(F.lag('cumSum') < F.col('cumSum'),…