Posts by Adriana Cavalcanti • 3 points
1 post
-
0
votes2
answers870
viewsQ: Adding total sum grouped to a new column Dataframe pyspark
I have a dataframe with the following columns: COL1 COL2 COL3 NEW_COL* A asd 1 8 B adf 2 9 A adg 8 1 B adh 9 2 C adj 7 7 D adk 1 1 Where NEW_COL = (total sum of col1 by type - the value of col3) /…