我有一个熊猫数据帧:
id value
14 122
15 120
16 190
17 490
18 328
19 309
20 323
我有一个id的列表L = [14,17,20]
,我想做两件事:
Get the list of indexes of those rows where for the id's is not in the list L
i.e.( index of rows 15,16,18,19)
而且
Delete the rows for the id's is not in the list L.
我的预期产出:
^{pr2}$
您可以将^{} 与^{} 一起使用,以反转布尔掩码
~
:然后^{} :
^{pr2}$备选方案:
替代方案:
相关问题 更多 >
编程相关推荐