Given a list containing monthly numerical data, how can I easily convert this into quarterly data?
x= [5,8,3,4,5,6,1,2,5,3,11,8] #monthly data for Jan-Dec
[5+8+3, 4+5+6, 1+2+5, 3+11+8] #converted to quarterly data
I wanted to do something like
[a+b+c for a,b,c in x] but x it says x is not iterable.
Have an answer?