0

I came accross to this python exercise with df as following:

   text_A             text_B 

0 LOVE it          love. it 
1 Make. It. Nice   make. it. (nice) 
2 Just do it       you can make it 
3 Just do it       you can make it

When i used this code : df[df.text_B == "love. It"], it will return as what I expected:

   text_A             text_B 

0 LOVE it          love. it 

But, what if I want to filter the df based on column 'textB' values so that it will only return rows that have 'love. it' and 'make. it. (nice)' in the new df?

   text_A             text_B 

0 LOVE it          love. it 
1 Make. It. Nice   make. it. (nice)

I used df[df.text_B == "love. it|make. it. (nice)"], but it doesn't work, i think it has to do with the '(nice)'.

Any ideas to fix this problem?

Thank you in advance!

Tristan
  • 13
  • 4

0 Answers0