There is a data-frame which consists of 3 columns.
+-----+----+-------+
| name| id |Subject|
+-----+---+--------+
| one| 1 |Science|
| two| 2 | Maths|
|three| 3 |Science|
| four| 4 | random|
+-----+---+--------+
My requirement is to replace the data of first column with the column name of third column so the result table will be like:
+-------+---+-------+
| name| id|Subject|
+-------+---+-------+
|Subject| 1|Science|
|Subject| 2| Maths|
|Subject| 3|Science|
|Subject| 4| random|
+-------+---+-------+
List item
Can someone help me how I can achieve this in pyspark.