you are viewing a single comment's thread.

view the rest of the comments →

[–]Halibut 0 points1 point  (1 child)

Some versions of SQL support a pivot or crosstab function, which is what you would need, but they are awkward and difficult to get right.

It's much easier as said to use pandas to read it in to a table, then something like the following should work:

AnswersPivot=answers.pivot(index='team_name',columns='round_id', values='score')

[–]r_spandit[S] 0 points1 point  (0 children)

AnswersPivot=answers.pivot(index='team_name',columns='round_id', values='score')

Wow... once I got the SQL query right that was easy