same as this python pandas: how to find rows in one dataframe but not in another? but with multiple columns
This is the setup:
import pandas as pd
d
Interesting
cols = ['col1','col2']
#get copies where the indeces are the columns of interest
df2 = df.set_index(cols)
other2 = other.set_index(cols)
#Look for index overlap, ~
df[~df2.index.isin(other2.index)]
Returns:
col1 col2 extra_col
0 0 a this
2 1 c just
3 2 b something
Seems a little bit more elegant...