I have the following two dataframes in pandas:
DF1:
AuthorID1 AuthorID2 Co-Authored
A1 A2 0
A1 A3 0
A1 A4 0
A2 A3 0
DF2:
AuthorID1 AuthorID2 Co-Authored
A1 A2 5
A2 A3 6
A6 A7 9
I would like (without looping and comparing) to find the matching AuthorID1 and AuthorID2 pairing in DF2 that exist in DF1 and update the column values accordingly. So the result for the above two tables would be the following:
Resulting Updated DF1:
AuthorID1 AuthorID2 Co-Authored
A1 A2 5
A1 A3 0
A1 A4 0
A2 A3 6
Is there a fast way to do this? As I have 7 millions rows in DF1 and looping and comparing would just take forever.
Update: note that the last two in DF2 should not be part of the update in DF1 since it doesn't exist in DF1