pd.DataFrame({'col1': [1,1,1,1,1,1, 2,2,2,2,2,2], 'col2': ['in', 'out','in', 'out','in', 'out','in', 'out','in', 'out','in', 'out'], 'col3':['A','B','C','D','E','F','G','H','I','J','K','L']})
I'm looking for an efficient way to transform the above dataframe to a table like this:
| Col1 | Col2 | Col3 |
| -----| ---- | ---- ---- |
| 1 | in |'A','C','E'|
| 1 | out |'B','D','F'|
| 2 | in |'G','I','K'|
| 2 | out |'H','J','L'|