looking for some way to filter my Data frame by few criteria's (Dataframe for example:
id Arrest Shift_num Description
0 True 20 Weapon
1 False 25 unarmed
2 True 30 Weapon
I would like to get DF with:
Description == Weapon and shift_num >= 25 and arrest == True (for example)
after few tries , that was my way, but i think it can be better than this :
arrest=(df.Arrest == True)
shift=(df.Shift_num >= 25)
weap= (df['Description'] == 'weapon')
print(df[arrest & shift & weap])
Thanks in advance :)
df[df['Arrest'].eq(True) & df['Shift_num'].ge(25) & df['Description'].eq('weapon')]