I have 2 dataframes for which I want to do a comparison. Please find the information below and appreciate any help on this.
df 1 shows the relationship between the IDs
df1 =
IDA IDB Relationship
A100 A200 Parent
A200 A500 Spouse
A111 A112 Child
A112 A111 Parent
df2 contains a list of IDs that I will check against df1 if there's any form of relationship between the ID's Party 1 and Party 2 and map the relationship over (the first instance in the event there's multiple relationships)
df2 =
Sender Receiver
[A900,A200] [A500,A220]
[A150,A100] [A400]
[A400,A112] [A500]
[A700,A112] [A111,A001]
Here's my expected output with explanations
Output =
Sender Receiver Relationship
[A900,A200] [A500,A220] Spouse #A200 and A500
[A150,A100] [A400] NAN #No match
[A400,A112] [A500] NAN #No match
[A700,A112] [A111,A001] Parent #A112 and A111