I have a dataframe with a columns for group and columns of answers of question:
Group Q1 Q2 Q3 Q4
0 1 A B C 6
1 1 B C A A
2 1 E F V A
3 2 R T Y O
4 2 M Z D F
And I want to move/melt/colapse the columns of the question to the rows, so the desired dataframe will look like this:
Group Question Answer
0 1 Q1 A
1 1 Q1 B
2 1 Q1 R
3 1 Q2 B
4 1 Q2 C
5 1 Q2 F
.. .. And So on until last row:
[2 Q4 F]
What is the best way to do so?