【发布时间】:2019-08-04 21:15:57
【问题描述】:
我有一个很长的文本块,其中包含我想要根据部分匹配 (90%) 删除的潜台词。
string = "Adam is a boy who lives in Michigan.
He loves to eat apples and oranges.
He also enjoys playing with his dog and cat.
Adam is a happy boy."
substring = "He loves to apple oranges"
我想回来
"Adam is a boy who lives in Michigan.
He also enjoys playing with his dog and cat.
Adam is a happy boy."
子字符串中没有出现“吃”和“和”这两个词,但我想删除整个句子“他喜欢吃苹果和橙子”。我真的不知道该怎么做。谢谢!
【问题讨论】:
标签: python text data-cleaning