我想删除函数中短语'Thank you'/'thank u'/'thanks!'... ect
的所有形式(小写/大写,缩写..)。你知道吗
我目前只是做努力匹配哪项工作,但有没有更有效的方法来做这件事?你知道吗
df.text_col.replace(to_replace='Thank you',value='',inplace=True,regex=True)
df.text_col.replace(to_replace='thank you',value='',inplace=True,regex=True)
df.text_col.replace(to_replace='th(.+)u',value='',inplace=True,regex=True)
.
.
我建议列举所有你想摆脱的
thank you
案例:然后使用以下一个衬垫进行不区分大小写的替换:
测试:
相关问题 更多 >
编程相关推荐