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
Being NEW_COL = (sum total of col1 by type - the value of col3) / (total qtd of col1 by type - 1)
In this column I need help, does anyone know how I can do it in a DataFrame with pyspark?
Thanks!