I am trying to group a column in a data frame, and I want the other columns to be added to a list of elements.
I have a data frame similar to this:
Route Station Position
A1 X1 P1
A1 X2 P2
A1 X3 P3
B2 Y1 P1
B2 Y2 P2
The expected output it should look like this:
Route Station Position
A1 [X1,X2,X3] [P1,P2,P3]
B2 [Y1,Y2] [P1,P2]
What is the correct way to do it?