I have time series data that looks like this:
time | Team A | Team B | Team C |
---|---|---|---|
14:00:00 | 2pts | 0pts | 0pts |
time | Team B | Team A | Team C |
14:01:00 | 3pts | 2pts | 0pts |
time | Team B | Team A | Team C |
14:02:00 | 3pts | 2pts | 2pts |
And so on, except there are lots of teams and lots of entries. The entries list the teams ranked by points, so the team with the most points will be on the leftmost column. I want to turn this into a chart, but obviously the rankings can change and I can’t just delete the labels on every other row and make it work. How do I transform the frame in pandas so it looks like this:
time | Team A | Team B | Team C |
---|---|---|---|
14:00:00 | 2pts | 0pts | 0pts |
14:01:00 | 2pts | 3pts | 0pts |
14:02:00 | 2pts | 3pts | 2pts |
I’m not sure if I should be creating a new frame out of this or if I can manipulate the existing one in place.
720 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.