I have a Dataframe with value predictions.
The first column is for the exact value and each new column is a week in the future. For each week a new row is added. As a result, I have the following example table:
Index W1 W2 W3 W4
1. 5 7 4 9
2. 8 7 10 11
and so on.
I want the values to all be in a single row and I want the other rows to be the number of weeks ahead (in my case exactly the column index of the value).
My table should look like this:
Index Value Week
1. 5 1
2. 7 2
3. 4 3
4. 9 4
5. 8 1
6. 7 2
7. 10 3
8. 11 4
I am working with python and have just declared the dataframe. How can this be done?