given a dataframe with two columns: User and Code, how can I filter out the user entries where they don't have at least x entries with a given Code?
E.g. I'd like to filter out all users when they don't have at least 5 occurances of a given type:
User Type
A Alpha
A Alpha
A Alpha
A Alpha
A Alpha
A Beta
A Beta
A Beta
B Alpha
B Alpha
B Alpha
B Alpha
B Alpha
Here I would like to filter out(remove) the 4x A with the Beta code (only 4 times here), while keeping everything else.
Thanks!