I have a list of dictionaries as follows
[{'grade': '1', 'past_student_sum': 1611},
{'grade': '2', 'past_student_sum': 1631},
{'grade': '3', 'past_student_sum': 1598},
{'grade': '1', 'current_student_sum': 1611},
{'grade': '2', 'current_student_sum': 1631},
{'grade': '3', 'current_student_sum': 1598}]
I got this list by combining 2 query sets in the following fashion:
grade_list = list(past_enrollments) + list(current_enrollments)
Is there a better alternatives to combine these in such a way to get a list that looks like this:
[{'grade': '1', 'past_student_sum': 1611, 'current_student_sum': 1621},
{'grade': '2', 'past_student_sum': 1511, 'current_student_sum': 1521}]