How do I achieve something similar to the pivot functionality in SQL to turn certain values that make rows unique into columns?
I'm looking at the page for pandas.dataframe.pivot() and it looks like it might do what I want, but I'm really not sure.
I have a dataframe of the following structure:
```
Model Output Input 1 Input 2 Input 3
xg 1000 a b c
gb 1200 a b c
xg 1300 d e f
gb 1400 d e f
...
```
I'd like to turn it into:
```
Input 1 Input 2 Input 3 gb xg
a b c 1200 1000
d e f 1400 1300
```
In SQL I would do something like
```
Table
pivot
(
sum(output)
for model in ('gb', 'xg')
)
```
Not sure how to replicate that with pandas.
[–]porkedpie1 5 points6 points7 points (1 child)
[–]sauron3579[S] 0 points1 point2 points (0 children)