0

I have a dataframe in which there is a column that contains text, and I have a list that consists of a group of words, and I want to make sure that one of the words in the list matches one of the words in the sentence and add it in a new column if it matches the list

g-plase = ['restauranta' , 'company' , 'garden']

df['place] a good restauranta in the East company for business solutions Spacious garden ..... .....

df["G-place"] =df[df["place"].isin(gplace)]['place']

But it does not work because it matches the sentence with the words in the list

How can I make it search for matching words only and not the whole sentence?

arwa
  • 1
  • 1

0 Answers0