pandas inverse double conditional code example
Example 1: how to slicing dataframe using two conditions
# when you wrap conditions in parantheses, you give order
# you do those in brackets first before 'and'
# AND
movies[(movies.duration >= 200) & (movies.genre == 'Drama')]
Example 2: select inverse with conditions pandas
In [411]:
df_a[~((df_a['id'].isin(values1)) & (df_a['car'].isin(values2)))]
# ^ ^
Out[411]:
id car
3 s4 mazda
5 s5 bmw
6 s4 audi