I have a dataset given below:
price category company time
10 A "Walmart" 01/01/2020
20 A "Walmart" 02/01/2020
30 A "Macy" 01/01/2020
40 A "Ross" 01/01/2020
50 B "Ross" 02/01/2020
60 A "Starbucks" 01/01/2020
70 B "Starbucks" 02/01/2020
I am trying to filter this data based on the number of categories which has more than 1 unique categories. Filtered data that has more than 1 unique categories are given below:
price category company time
40 A "Ross" 01/01/2020
50 B "Ross" 02/01/2020
60 A "Starbucks" 01/01/2020
70 B "Starbucks" 02/01/2020
Is there any way to do this efficiently in pandas python? Thanks.