0

I have this pandas dataframe here:

    0      1
0  col_a   0
1  col_b   2
2  col_c   3
3  col_a   4
4  col_b   5
5  col_c   6

Each row at column zero holds a specific value. I would like to turn the rows into columns I can index like so:

  col_a  col_b  col_c
0     1      2      3
1     4      5      6

I've tried following this answer, but I can't get it to output. Thank you in advance.

Duplicate didn't help. So I updated it.

0 Answers0