熊猫中的SQL“哪里没有ID(从A选择ID)”是可能的?

时间:2019-07-02 10:27:02

标签: python-3.x pandas

我希望通过纯熊猫使用此sql查询:

select *
from A
where Id is not in (select id from B)

有使用熊猫的东西吗? 还有其他建议吗?

1 个答案:

答案 0 :(得分:1)

在Pandas中,您可以通过以下方式实现它:

myDF[~myDF.Id.isin(myDF2.Id)]