0

I am bit stuck.

I am trying to drop rows from a DF based on a word exclusion list.

exclude=["Word_1","Word_2","Word_3"]
global_df=global_df[~global_df.title.str.contains(exclude)]

As a result I expect to global_df not to have rows that contains any of the 3 words in the title column. In short - I want to filter out columns that contains specific words in their strings (which could be whole sentences).

Thank you

Yavor I
  • 67
  • 5

0 Answers0