In my dataframe I want to delete those groups of column B, in which all values in column C are smaller than 3.
So there should only be those groups left, which only have values in column C that are bigger than 3.
| B | C |
|---|---|
| 11 | 1 |
| 22 | 2 |
| 11 | 2 |
| 22 | 4 |
| 22 | 1 |
| 33 | 2 |
| 33 | 1 |
| 22 | 4 |
So in my example only group 22 should stay.
Probably something like this pseudo code:
df_clean = df.groupby('B')['C']< 3.0
How do I code an algorithm that can do this?