I have pandas df like below:
Id | Period | Value1 | Value2 |
---|---|---|---|
1 | 3 | 20 | 60 |
1 | 4 | 30 | 70 |
2 | 3 | 40 | 80 |
2 | 4 | 50 | 90 |
How can I use Period as additional column, like this: (to have Period 3, 4 as separate columns and under each column with periods I have subcolumns Value1 and Value2)?