I have a dataframe df
like the following
df
A B
0 1 Tom
1 1 Alice
2 2 Sarah
3 3 Jack
I would like to groupby and count on A
and have something like the following
df
A count names
0 1 2 Tom, Alice
1 2 1 Sarah
2 3 1 Jack