Parsifal
Parsifal

Reputation: 342

Sql in Pandas "where id not in (select id from A)" is possible?

I wish to use this sql query using pure pandas:

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

Is there something using pandas? Any alternative suggestion?

Upvotes: 0

Views: 275

Answers (1)

Lethos
Lethos

Reputation: 26

In Pandas, you can implement it this way :

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

Upvotes: 1

Related Questions