I have a Series with 305 entries that with Datatime index. the data looks like this
1992-01-31 1.123077
1992-02-28 -2.174845
1992-03-31 -3.884848
1992-04-30 8.682919
1992-05-29 1.312976
1992-06-30 7.851080
1992-07-31 -3.192788
1992-08-31 -7.351976
1992-09-30 -6.782217
1992-10-30 -17.182738
1992-11-30 3.898782
1992-12-31 -26.190414
1993-01-29 2.233359
1993-02-26 6.709006
continues with monthly data till December 2017
I want to reshape the data as a DataFrame that has all Years for Rows and Months for Columns and data to fill in as appropriate
January February March etc >> December
2017 values values values values values
2016 values values values values values
2015 values values values values values
etc \\//
1992 values
I looked at other posts and tried reshape and asmatrix but given that it is uneven series I keep getting this error.
ValueError: total size of new array must be unchanged.
What I really want to do is if the matrix is odd shaped then insert NaN for the missing values. So if there was no November or December values in 2017 they would be NaN
let me know if anyone can help