I have a pivot table using CategoricalDtype so I can get the month names in order. How can I can drop the column name/label "Month" and then move the month abbreviation names to the same level as "Year"?
... .pivot_table(index='Year',columns='Month',values='UpClose',aggfunc=np.sum))
Current output:
Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total
Year
1997 12.0 8.0 8.0 12.0 11.0 12.0 14.0 10.0 10.0 10.0 10.0 9.0 126.0
1998 10.0 12.0 14.0 12.0 9.0 11.0 10.0 8.0 11.0 10.0 10.0 12.0 129.0
Desired output:
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total
1997 12.0 8.0 8.0 12.0 11.0 12.0 14.0 10.0 10.0 10.0 10.0 9.0 126.0
1998 10.0 12.0 14.0 12.0 9.0 11.0 10.0 8.0 11.0 10.0 10.0 12.0 129.0
If I use, data.columns.name = None
it will remove the "Month" label, but it doesn't drop the month abbreviations to the same level as "Year.