I have a data frame
df
A B
0 test1 1
1 test2 4
2 test3 1
3 test4 2
df1
C
0 test3
1 test5
I want to conditionally merge them to a new dataframe
df2
A B
0 test1 1
1 test2 4
2 test3 0
3 test4 2
4 test5 0
A new data frame where if the value in column A is equal to column C, then while merging just update its column B value to a default of 0 and if there there isn't a value that exists in column A which is equal to a value in column C just add it to the data frame as shown above with a default value of 0.