【发布时间】:2020-05-19 17:04:11
【问题描述】:
我是 Pandas 的初学者,我想知道如何为以下我想执行的逻辑操作编写代码。
有人可以告诉我他们会怎么做吗?
如果单词在 pandas 系列中,则从 DataFrame 中的字符串中删除该单词。
让“A”系列成为熊猫系列如下:
index word
0 foo
1 bar
2 baz
让 DataFrame "B" 成为我们要修改的 DataFrame。
index string
0 foo bar hello there
1 foo Lax
2 bar Kay
3 John Smith
期望的输出:
0 hello there
1 Lax
2 Kay
3 John Smith
【问题讨论】:
-
A系列中的任何单词或与B系列相同索引对应的单词?
标签: python pandas jupyter-notebook data-munging data-wrangling