I have a main DF1 like this
Name | Type | Price | Quantity |
---|---|---|---|
Product A | Phone | 100 | 5 |
Product B | TV | 30 | 3 |
DF2
Name | Type | Image | Shelf Position |
---|---|---|---|
Product A | Phone | image1 | Shelf A |
Product A | TV | image 2 | Shelf B |
Product A | Speakers | image 3 | Shelf C |
Product B | Fridge | image 4 | Shelf A |
Product B | TV | image 5 | Shelf F |
bI'm wondering if there is a neat solution to create a DF by LEFT JOIN DF2 with DF1 while matching by more than 1 column (in this case, the match will be on Name and Type)
Name | Type | Price | Quantity | Image | Shelf Position |
---|---|---|---|---|---|
Product A | Phone | 100 | 5 | image1 | Shelf A |
Product B | TV | 30 | 3 | image 5 | Shelf F |
I was going to create a new combined column (name_type) and rely on it to left join but I'm hoping to find out if there is a better way?
Thank you