I used the value_counts to see how many times an id occurs in my DataFrame. Is it also possible to access the values of these counts for a certain column with the same ids. For example:
colA colB colC
1. banana, 50, 60
2. apple, 30, 70
2. apple, 20, 80
2. lemon, 30, 90
2. banana, 25, 10
2. lemon, 50, 15
2. apple, 5, 85
banana['colB']: [50, 25]
apple['colB']: [30, 20, 5]
etc...
I don't know what the ids are in colA so they have to be variable... I managed to do it in a loop using the df.loc but this is very time consuming as the dataframe is very large.