create a martix from a dataframe with a datetimeindex

12 Views Asked by At

I have a dataframe that has monthly data. The index is a datetimeindex & the other column is a numeric column.

What I want to do is create a matrix where I have the 12 months across the top and the years as rows and the numeric value as the elements of the matrix.

Is there a clever way to do this without me looping?

0

There are 0 best solutions below