I need split one column into 4, based on another column values in python/pyspark. I tried filtering it based on code and joining the multiple df's. Is there a better way of doing this ?
Code score ID
AAA 12 ABCD
BBB 14 ABCD
CCC 16 ABCD
DDD 67 ABCD
AAA 89 XYZ
BBB 65 XYZ
CCC 19 XYZ
DDD 56 XYZ
ID score_AAA score_BBB score_CCC score_DDD
ABCD 12 14 16 67
XYZ 89 65 19 56