I have a small question about pandas dataframe. How can I pivot my dataframe from this
AGE | GROUP-A | ... | GROUP-Q
----------|---------|-----|---------
00-04 |77 | |133
05-17 |117 | |106
18-25 |64 | |110
to this
GROUP | 00-04 | 05-17 | 18-25
------|-------|-------|-------
A |77 |117 |64
... | | |
Q |133 |106 |110
pivot table. I think what you really want to do isdf.transpose(). You will need to then do some more work to change the column/row names as you have them in the question. The answer here may help you with that.