I have this table as a csv file.
col1 | col2 | col3 |
---|---|---|
15 | y | 55 |
z | 12 | |
99 | y | 26 |
25 | y | 14 |
z | 88 |
And I expect this:
col1 | y | z |
---|---|---|
15 | 55 | 12 |
99 | 26 | nan |
25 | 14 | 88 |
I tried df.stack() but it didn't work
I have this table as a csv file.
col1 | col2 | col3 |
---|---|---|
15 | y | 55 |
z | 12 | |
99 | y | 26 |
25 | y | 14 |
z | 88 |
And I expect this:
col1 | y | z |
---|---|---|
15 | 55 | 12 |
99 | 26 | nan |
25 | 14 | 88 |
I tried df.stack() but it didn't work