I have one list of dictionary as given below.
d = [
{'value': [{'student_id': 45522, 'marks': 75}, {'student_id': 70515, 'marks': 80}],'year':2001},
{'value': [{'student_id': 45522, 'marks': 35}, {'student_id': 70515, 'marks': 90}],'year':2002},
{'value': [{'student_id': 45522, 'marks': 60}, {'student_id': 70515, 'marks': 89}],'year':2003}
]
I want result as below.
student_marks_data = [
{"student_id":45522,years:[2001,2002,2003],marks:[75,30,60]},
{"student_id":70515,years:[2001,2002,2003],marks:[80,90,89]}
]
I have read about itertools but don't know how to use it to solve this.