I have the following list:
data = [[2004,1,1,1,50], [2008,2,28,1,150],[1984,5,1,3,20],[1982,5,1,7,20], [1982,5,8,7,20]]
The data represents the Year, Month, Day, Day of week, count.
I want to obtain a dictionary of the total counts per day of the week. Something like this
results = {1:200,
2:0,
3:20,
4:0,
5:0,
6:0,
7:40,
}
I believe the best way to do this, please correct me if i'm wrong, is to use collections.Counter. I abandoned this effort for a dictionary comprehension but have been unable to solve the problem
solution = {(x,i) for x[3], i[4] in data}