One row per student, one column per subject

Data framesMedium10 min

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) -> dataframe
Example 1
Inputwide_marks(marks)
marks
studentsubjectscore
anamath88
anascience92
benmath75
benscience64
caramath95
carascience81
Output
studentmathscience
ana8892
ben7564
cara9581