Unpivot subject columns back to rows

Data framesMedium10 min

Your task

Given wide with columns student, math and science, turn the two subject columns back into rows. Return student, subject and score, sorted by student ascending and then subject ascending.

Examples

long_marks(wide: dataframe) -> dataframe
Example 1
Inputlong_marks(wide)
wide
studentmathscience
ana8892
ben7564
Output
studentsubjectscore
anamath88
anascience92
benmath75
benscience64