Unpivot subject columns back to rows
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) -> dataframeExample 1
Input
long_marks(wide)wide
| student | math | science |
|---|---|---|
| ana | 88 | 92 |
| ben | 75 | 64 |
Output
| student | subject | score |
|---|---|---|
| ana | math | 88 |
| ana | science | 92 |
| ben | math | 75 |
| ben | science | 64 |