Merge / Join two data frames based on 3 columns in pandas
If I understand your logic correctly you want to do a outer join on HOUSE_NAME and HOUSE_NUMBER (union).
Then you want to do a inner join on POSTCODE (intersection).
You need to understand the difference between how you join and give some more information about what  you except in the end.
I have two dataframes df_pp and df_epc containing 3 common columns, POSTCODE, HOUSE_NAME, HOUSE_NUMBER. I want to merge these two dataframes into one dataset using the following logic.
(POSTCODE && (HOUSE_NAME  || HOUSE_NUMBER))
So, I want to pick a row in the new merged dataset if the postcode matches and either of the house number or house names match. I tried the following code. But it is not what I expected.
new_df = pd.merge(left=df_epc, right=df_pp, on=['POSTCODE', 'HOUSE_NUMBER', 'HOUSE_NAME'], how='inner') #690