I've a dataframe (called 'df') which contains a column called 'grades'. This column contains a list of grades. The data in this column is of type 'object'.
student_id grades
0 11 [A,A,B,A]
1 12 [B,B,B,C]
2 13 [C,C,D,B]
3 21 [B,A,C,B]
I'm hoping to create a new column called 'maths_grades', which will store the 3rd element in the grades list.
Example Output:
student_id grades maths_grade
0 11 [A,A,B,A] B
1 12 [B,B,B,C] B
2 13 [C,C,D,B] D
3 21 [B,A,C,B] C
Whats best was to go about this?