【发布时间】:2021-04-24 11:52:37
【问题描述】:
我有一个 Pandas 数据框 (Python 3.x),如下所示:
| title | type | content |
|---|---|---|
| Mango | Paragraph | Mango is called the king of fruits. It is a stone fruit produced from numerous species of tropical trees..... |
| Dates | Paragraph | [Dates] /n [Paragraph] /n Dates have been a staple food of the Middle East and the Indus Valley for thousands of years...... |
| Mango | Essay | "Mango" "Essay" Mango is called the king of fruits. It is a stone fruit produced from numerous species of tropical trees..... |
| Apple | Article | Apple /n Article /n An apple is an edible fruit produced by an apple tree..... |
| ...... | ...... | ................................................................................... |
在某些行中,“title”和“type”列的文本也出现在“content”列中。如果“内容”列中存在“标题”和“类型”,我需要删除整行。 我尝试了很多次,但未能删除包含其他列相同文本的整行。 请帮忙!!
【问题讨论】:
标签: python-3.x pandas text nlp