If I have pandas data frame like this:
| F1 | F2 | F3 | Flag
---------------------
0 | 10 | 22 | 54 | True
1 | 3 | 77 | 9 | False
How can I turn it into this:
| F | Val | Flag
-------------------
0 | F1 | 10 | True
1 | F2 | 22 | True
2 | F3 | 54 | True
3 | F1 | 3 | False
4 | F2 | 77 | False
5 | F3 | 9 | False
I've looked into pivot tables and multi indexing, but i'm having a hard time quite getting it to fit together.