delete groups of rows based on condition,df.groupby('A').filter(lambda g: (g.B == 123).any())