I am using the Iris flower data set:
In the species, I have three different items of information:
print(df['Species'].unique())
['setosa' 'versicolor' 'virginica']
I want to filter out all rows and all rows where Species= 'setosa'
and Petal.width'= 0.4
:
df[df['Species']!='setosa' & (df['Petal.width'] != '0.4')]
The problem is that this function delete all rows which contain df['Species']=='setosa'
and all rows which contains df['Petal.width'] == '0.4'
.
I want to apply two conditions in the same time.
How do I solve the problem?