I have two dataframe d1 and d2 as follows:
d1 
A   B   C    D
X   6   7   23
Y   3   4   35
B   5   8   45
D   11  7   15
L   10  1   5
d2 
A   C 
Y   4 
L   1 
D   7 
and want new column in d1 E as follow: 
A   B   C   D   E
X   6   7   23  0
Y   3   4   35  1
B   5   8   45  0
D  11   7   15  1
L  10   1   5   1
new column E is added based on the condition of data in column A & C of d2 matched with data in column A & C of d1, number of rows are different in booth dataframe.
 
    