I have 2 Dataframes as:
df1 = pd.DataFrame(data = {'col1' : [1, 2, 3, 4, 5], 'col2' : [10, 11, 12, 13, 14], 'col3' : [8, 9, 3, 9, 7], 'col4' : [3, 5, 9, 4, 8]})
df2 = pd.DataFrame(data = {'col1' : [1, 2, 3, 3,5], 'col2' : [10, 10, 14, 12, 14]})
df1
col1 col2 col3 col4
0 1 10 8 3
1 2 11 9 5
2 3 12 3 9
3 4 13 9 4
4 5 14 7 8
df2
col1 col2
0 1 10
1 2 10
2 3 14
3 3 12
4 5 14
I want to filter df1 based on column col1 and col2 of df2, i.e. check if col1 & col2 of df1 is same as col1 & col2 of df2. If there is a match then exclude those rows from df1 and print the remaining. The output for given dataframe should be like this:
col1 col2 col3 col4
0 4 13 9 4
1 5 14 7 8
Please help me solve this, preferably without using 'merge'