I need to filter my DataFrame based on two conditions. I need to filter out any observation where cause = 'fire' AND the flag = 1. It can be fire and flag = 0. It can be flag = 1 and cause != 'fire'. Just not both at the same time.
I tried the following:
df.loc[(df['flag'] != 1) & (df['cause'] != 'Fire')]
But this gets rid of all 1s and/or fire. I need both conditions to be met to be filtered out. Not sure where I'm going wrong.