I have monthly data. I want to convert it to "periods" of 3 months where q1 starts in January. So in the example below, the first 3 month aggregation would translate into start of q2 (desired format: 1996q2). And the data value that results from mushing together 3 monthly values is a mean (average) of 3 columns. Conceptually, not complicated. Does anyone know how to do it in one swoop? Potentially, I could do a lot of hard work through looping and just hardcode the hell out of it, but I am new to pandas and looking for something more clever than brute force.
1996-04 1996-05 1996-06 1996-07 ..... 25 19 37 40
So I am looking for:
1996q2 1996q3 1996q4 1997q1 1997q2 ..... avg avg avg ... ...