I have this simple dataframe
Num Fruit Price 1 Apple 1.00 1 Apple 1.00 2 Apple 1.50 2 Orange 1.50 3 Orange 1.00 3 Banana 0.50 I want to drop all the rows which have the fruit Apple or Orange
The expected output should be like this:
Num Fruit Price 3 Banana 0.50 I tried to doing the following syntax, but somehow it did not drop all the rows in the dataframe
>>> df.drop(df.Fruit.isin(["Apple","Orange"])) Fruit Num Price 2 Apple 2 1.50 3 Orange 2 1.50 4 Orange 3 1.00 5 Banana 3 0.50 Any suggestion how to solve this?