I have the following dataframe df:
Video 1 1 1 1 1 1 1 1 1 1 ... 36 36 36 36 36 36 36 36 36 36
Confidence Value 3 3 4 4 4 5 5 3 5 3 ... 3 3 3 2 4 2 3 3 3 3
Where the row Video
is the row with the names of the columns in the dataframe (i.e. the row with bold font that states the names of each column).
What I want is to rearrange this dataframe so that the output is this:
Video 1 2 3 ... 36
0 3 5 4 ... 3
1 1 2 3 ... 2
2 2 4 4 ... 5
3 4 5 4 ... 3
...
I have tried searching different ways to append, concatenate, merge etc. the columns in the way that I want but I can't figure out how since there are multiple instances of each Video, i.e. multiple 1, 2, .. 36
.
So, for each of these multiple instances, I want to make one column of these with the Video number as the column name, and the rows be all the confidence values, as shown above.
Is that possible?