This might be a repeated question, but I couldn't get the answers of the other question.
I've a sample dataframe1
city date user manager mobile
LA 2021-03-01 XYZ ABC 123456
LA 2021-03-02 XYZ ABC 123456
LA 2021-03-03 XYZ ABC 123456
FL 2021-03-01 DEF MNO 099876
FL 2021-03-01 DEF MNO 099867
TX 2021-03-01 KLM PQR 9988887
How do I filter the df in order to get the data of user
whose count is more than 1 in the df.
As the count of XYZ and DEF exceeds 1, the rows of that users should be filtered out.
Desired result
city date user manager mobile
LA 2021-03-01 XYZ ABC 123456
LA 2021-03-02 XYZ ABC 123456
LA 2021-03-03 XYZ ABC 123456
FL 2021-03-01 DEF MNO 099876
FL 2021-03-01 DEF MNO 099867