My dataframe looks like this:
| DateID | cinema1 | cinema2 | cinema3 |
|---|---|---|---|
| 20220101 | 100 | 300 | 40 |
| 20220102 | 95 | 280 | 40 |
| 20220103 | 90 | 300 | 45 |
I want my dataframe to look like this:
| DateID | CinemaID | Output |
|---|---|---|
| 20220101 | cinema1 | 100 |
| 20220101 | cinema2 | 300 |
| 20220101 | cinema3 | 40 |
| 20220102 | cinema1 | 95 |
| 20220102 | cinema2 | 280 |
| 20220102 | cinema3 | 40 |
| 20220103 | cinema1 | 90 |
| 20220103 | cinema2 | 300 |
| 20220103 | cinema3 | 45 |
I tried the stack() method which visually displays the data correct but I don't want to have DateID grouped (multilevel index). Instead I want the DateIDs to be displayed for each row as in the table above.
Please advise, thank you!