I have numeric data within Student marks and I would like to have single record for every Student with all his related data spread into many records.
df = pd.DataFrame([('Adel', "Subj1", 3.50 ,2.57),
('Adel', "Subj2", 2.75 ,3.6 ),
('Alexa',"Subj1", 1.75 ,3.25) ,
('Alexa',"Subj3", 3.15 ,2.25) ],
columns=('Name', "Subj","Med", "Ach" ))
I developed a long loop statement and have the underneath table, but I thought there is maybe a better way .
Any shortcut for a such pivot table? Of course, I may have missing Data since not all Students attend all Courses.