I have three lists in python that I retrieved from database.
[(34, 75), (7, 50), (36, 100)]
[(7, 73.3), (34, 100), (36, 65)]
[(34, 80), (36, 85.6),(7, 85)]
In following lists we have common first element of tuple like we have first element '7' in all three lists and same goes with '34' and '36' as well.First element is "id" and second element are "rating" in first list, "marks" in second list and "slots" in third list. I want to create a new list in which will put a unique entry by first element of tuple and then average of 2nd value from all three lists. I want my out put to look like
[(34, 85), (7, 69.43), (36, 83.53)]
first element of every tuple is common element from all three lists and second element is average of corresponding element from all three lists.
how to do it in python?
What I have tried:
I don't have idea how to do it thats why need code for it.