【发布时间】:2014-09-29 20:35:16
【问题描述】:
现在,我有一个这样的 DF
Words Words1
Little Red Red Apple
Cracker Barrel Wood Grain
Far Away Man Flat Rate Shipping
我想根据某些词不能同时出现在同一个短语中的特定条件从我的 DF 中删除单元格。
例如:从以下 DF 中删除单元格,其中“Flat”与“Shipping”在同一个短语中,并且“Far”与“Man”在同一个短语中。我一直在玩这样的东西,但它不起作用......
Words.where(Words.applymap(lambda x: 'Flat' and 'Shipping' in x))
有什么想法吗?
【问题讨论】:
标签: python-3.x pandas