I have a pandas dataframe with a datetime index that I'd like to reorient as a grid from a pandas time-series dataframe.
My dataframe looks like this:
DATE VAL
2007-06 0.008530
2007-07 -0.067069
2007-08 0.026660
2007-09 0.016237
2007-10 0.025145
2007-11 -0.063666
2007-12 -0.002118
2008-01 -0.059951
2008-02 -0.033422
2008-03 0.008978
2008-04 0.039997
2008-05 0.043563
2008-06 -0.076166
...
And I'd like to reorient, with [year]
rows and [month]
columns, to look like this:
Jan Feb Mar ... Jun Jul Aug Sep Oct Nov Dec
2007 0 0 0 ... .008530 -.067069 .026660 .016237 .025145 -.06366 -.025145
2008 -.05995 -.033422 .00897 ... -.076166 ...
...
reshape/stack/unstack methods appear to do a version what I'd like, but as I have a single date index, these don't lend themselves to my dataframe.