I have two data frames df1
and df2
as shown below:
df1
Date ID Amount BillNo1
10/08/2020 ABBCSQ1ZA 878 2020/156
10/08/2020 ABBCSQ1ZA 878 2020/157
10/12/2020 AC928Q1ZS 3998 343SONY
10/14/2020 AC9268RE3 198 432
10/16/2020 AA171E1Z0 5490 AIPO325
10/19/2020 BU073C1ZW 3432 IDBI436-Total
10/19/2020 BU073C1ZW 3432 IDBI437-Total
df2
Date ID Amount BillNo2
10/08/2020 ABBCSQ1ZA 878 156
10/11/2020 ATRC95REW 115 265
10/14/2020 AC9268RE3 198 A/432
10/16/2020 AA171E1Z0 5490 325
10/19/2020 BU073C1ZW 3432 436
10/19/2020 BU073C1ZW 3432 437
My final answer should be:
Matched
Date ID Amount BillNo1 BillNo2
10/08/2020 ABBCSQ1ZA 878 2020/156 156 # 156 matches
10/14/2020 AC9268RE3 198 432 A/432 # 432 matches
10/16/2020 AA171E1Z0 5490 AIPO325 325 # 325 matches
10/19/2020 BU073C1ZW 3432 IDBI436-Total 436 # 436 matches
10/19/2020 BU073C1ZW 3432 IDBI437-Total 437 # 437 matches
Non Matched
Date ID Amount BillNo1 BillNo2
10/08/2020 ABBCSQ1ZA 878 2020/157 NaN
10/12/2020 AC928Q1ZS 3998 343SONY NaN
10/11/2020 ATRC95REW 115 NaN 265
How do I merge two dataframes based on partial string match of Column =['BillNo1','BillNo2']
?