I have the following dataframe:
| Position Played | Champion | Result | ID | Side |
|---|---|---|---|---|
| top | riven | 0 | 1 | blue |
| jg | jax | 0 | 1 | blue |
| top | fiora | 1 | 1 | red |
| jg | lee sin | 1 | 1 | red |
| top | mundo | 0 | 2 | blue |
| jg | jax | 0 | 2 | blue |
| top | kayle | 1 | 2 | red |
| jg | olaf | 1 | 2 | red |
and I would like to get the following dataframe:
| top | jg | Result | ID | Side |
|---|---|---|---|---|
| riven | jax | 0 | 1 | blue |
| fiora | lee sin | 1 | 1 | red |
| mundo | jax | 0 | 2 | blue |
| kayle | olaf | 1 | 2 | red |
I've tried using several commands and no success
source https://stackoverflow.com/questions/73347379/how-to-combine-melt-transpose-and-pivot-functions-in-dataframe-pandas
Comments
Post a Comment