I have a dataframe with a few time series of measurement taken every hour. After some elaboration and grouping by month, the index is:
PeriodIndex(['2015-01', '2015-02', '2015-03', '2015-04', '2015-05', '2015-06',
'2015-07', '2015-08', '2015-09', '2015-10', '2015-11', '2015-12',
'2016-01', '2016-02', '2016-03', '2016-04', '2016-05', '2016-06',
'2016-07', '2016-08', '2016-09', '2016-10', '2016-11', '2016-12'],
dtype='period[M]', name='DT', freq='M')
I would like (and it'd help a lot) to convert this into a multiindex with the years as first level and months as the second.
How can I do it?