One row per student, one column per subject
Your task
Given marks with columns student, subject and score, reshape it so each student has one row and each subject is its own column. Return student, math and science, sorted by student ascending.
Examples
wide_marks(marks: dataframe) -> dataframeExample 1
Input
wide_marks(marks)marks
| student | subject | score |
|---|---|---|
| ana | math | 88 |
| ana | science | 92 |
| ben | math | 75 |
| ben | science | 64 |
| cara | math | 95 |
| cara | science | 81 |
Output
| student | math | science |
|---|---|---|
| ana | 88 | 92 |
| ben | 75 | 64 |
| cara | 95 | 81 |