Suppose I have a pandas DF with ‘A’,’B’,’C’ as column name
A B C
a1 b11 c11
a1 b12 c12
a2 b21 c21
a2 b22 c22
I can group by ‘A’, but can I get
A B C
a1 [b11,b12], [c11,c12]
a2 [b21,b22], [c21,c22]
without any aggregation? Hopefully the order (b11 before b12) is kept as occured in the original table.
I don’t know how to do exactly what you want, but perhaps this is close enough:
Using that I then get:
also:
and finally:
Hope that helps.