Reputation: 429
I have data like this
and I need output like this
Upvotes: 1
Views: 98
Reputation: 26676
Groupby everything and find max value. Code below
from pyspark.sql import Window
df.withColumn('Value',max('Amount').over(Window.partitionBy())).show()
Upvotes: 1