I am finding it hard to transpose columns in DF. Given below is the base dataframe and the expected output
Student Class Subject Grade Sam 6th Grade Maths A Sam 6th Grade Science A Sam 7th Grade Maths A- Sam 7th Grade Science A Rob 6th Grade Maths A Rob 6th Grade Science A- Rob 7th Grade Maths A- Rob 7th Grade Science B Rob 7th Grade AP A Expected output:
Student Class Math_Grade Science_Grade AP_Grade Sam 6th Grade A A Sam 7th Grade A- A Rob 6th Grade A A- Rob 7th Grade A- B A Please suggest what is the best way to solve this.