我想返回包含搜索列表中确切单词的句子
df = pd.read_excel('C:/Test 1012/UOI.xlsx')
a = df['Content']
searchfor =['hot' ,'yes' and 200 more words in it]
b = a[a.str.contains('|'.join(searchfor))]
print(b)
例如:
Content = ['the photo is good','nice picture'...]
结果不应该打印任何句子,但是,'照片'包含'热'字,结果给我'照片是好的'。有人知道怎么解决这个问题吗?我只想得到的结果完全包含搜索列表中的单词
使用为
searchfor
的每个值添加的单词边界:相关问题 更多 >
编程相关推荐