I have the following pandas dataframe:
I want to change this dataframe in the following way: I want to have the ID column as index and the month for each index in a column named month, and then all the values as follow:
ID MONTH VAL
1 Jan nan
1 Feb nan
1 Mar nan
1 Apr nan
1 May nan
1 Jun nan
1 Jul nan
1 Aug 94.0000
1 Sep 113.0000
1 Oct 21.0000
1 Nov nan
2 Jan 107.00000
.
.
.
7 Nov nan
The order of the month is not important. Is there an easy way to do it?