Pandas .filter
Intuition\n Describe your first thoughts on how to solve this problem. \nSolution using .filter\n\n# Approach\n Describe your approach to solving the problem. \
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nSolution using .filter\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimport pandas as pd\n\ndef find_classes(courses: pd.DataFrame) -> pd.DataFrame:\n    return courses.groupby(\'class\').filter(lambda x: len(x) >= 5)[[\'class\']].drop_duplicates()\n```
['Pandas']