Good day,
I wish to do pandas merge on in SQL fashion where I get items from set A which are not present in set B. How to do this with Pandas?
select * from a
left join
b
on a.key1 = b.key1 and a.key2= b.key2
where b.key1 is NULL or b.key2 is NULL
Sql example from javarevisited.blogspot.com.
Closest what I've found is another SO question, yet feels 'unPandas' and gets quite lengthy with multiple joining keys.
My best 'work around': Inner join on A and B and then drop common elements from A. Something akin to:
common = pd.merge(a, b, how='inner', left_on='key', right_on='key')
new_a = a[~a['key']isin(common['key']]
So any neater way to accomplish this?