Have two dataframes
import pandas as pd
df1 = pd.DataFrame([['tom', 2, 11111]], columns=["name", "cell", "marks"])
df2 = pd.DataFrame([['tomm', 2, 11111, 2548],
['matt', 2, 158416, 2483],
['tonmmm', 2, 11111, 2549]
], columns=["name", "cell", "marks", "passwd"])
Input
df1
name cell marks
0 tom 2 11111
df2
name cell marks passwd
0 tomm 2 11111 2548
1 matt 2 158416 2483
2 tonmmm 2 11111 2549
map two dataframe which has similar columns
get columns from df2 which has match atleast a count of 2. here cell and marks matches with df1 with 2 values
expected output:
name cell marks passwd
0 tomm 2 11111 2548
1 tonmmm 2 11111 2549
cellandmarksmatches with df1 with 2 valuescellandmarksmatches with df1 with 2 values