I do not see this in the SQL comparison documentation for Pandas. What would be the equivalent of this SQL in Pandas?
select a.var1, a.var2, b.var1, b.var2 from tablea a, tableb b where a.var1=b.var1 and a.var2=b.var2 and a.var3 <> b.var3
I have a merge code as follows:
df = pd.merge(a, b, on=['VAR1','VAR2'], how='inner')
How to include the "not equal" part?
and a.var3 <> b.var3
source share