'Filter rows in dataframe based on value counts [duplicate]

I have a large dataframe/Questionaire df (871 x 24) containing a column named "Identifier" which stores an unique ID for each of the participants. I want to filter out the participants who respondend above or equal to 10 times and make a new dataframe. So far I've managed to filter out which of the unique ID's fullfills the condition:

df['Identifier'].value_counts()>=10

Which outputs a true or false vector of length 74 matching the number of participants. Now I want to remove the ID's that do not meet this condition from the df (871 x 24), so I'll end up with a smaller matrix.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source