So I have been trying to figure out how to write the simplest if statement in order to check if the string "A" exist in the rootID and "B" exist in the parentID in any of the rows. I then want to remove that row. In the following dataframe I would have wanted to remove row 0 in that case.
rootID parentID jobID time
0 A B D 2019-01-30 14:33:21.339469
1 E F G 2019-01-30 14:33:21.812381
2 A C D 2019-01-30 15:33:21.812381
3 E E F 2019-01-30 15:33:21.812381
4 E F G 2019-01-30 16:33:21.812381
I know how to check if one element exists such as
if df['rootID'].str.contains("A").any()
but how do I do it when I need to check for two different strings in two columns?