0

I have a dataset which contains multiple keywords and I want to check if title contains the same key or not. it should be row by row partial match.

I have tried this code but it is not working for indic words/keys:

for string in df['key']:
    test = df['title'].str.contains(string,case=False, na=False) 
    print(test)

Sample dataset:

dataset

Expected Output:

output

Mahesh Thorat
  • 1
  • 4
  • 11
  • 22
riya23
  • 1
  • 1
  • Does this answer your question? [Filter pandas DataFrame by substring criteria](https://stackoverflow.com/questions/11350770/filter-pandas-dataframe-by-substring-criteria) – JonSG Apr 17 '23 at 13:48
  • @JonSG I tried this one but it does not work for indic words. it works for english words only. – riya23 Apr 17 '23 at 14:48

1 Answers1

0

I don't have Indic keyboard, but have you tried the easy solution:

for line in list_of_lines:
    if str(line['key']).lower() in str(line['title']).lower():
        print('True')
    else:
        print('False')
apiuser
  • 21
  • 5