if i understood it correctly, i have an small example below where the dataFrame is called df
and i want to remove the mixfruit
to be searched and deleted.
>>> df
name num
0 apple 5
1 banana 3
2 mixfruit 5
3 carret 6
One way is as other mentioned can go with str.contains
as follows ..
>>> df[~df.name.str.contains("mix")]
name num
0 apple 5
1 banana 3
3 carret 6
You can use isin
as well, which will drop all rows containing string
>>> df[~df['name'].isin(['mixfruit'])]
name num
0 apple 5
1 banana 3
3 carret 6
However, you can achieve the same as follows...
>>> df[df['name'] != 'mixfruit']
name num
0 apple 5
1 banana 3
3 carret 6