Could please help me how to make the operation below. I think this is the most particular thing that i need to do in pandas at the momment.
Basicaly i need to merge a 2 dataframes, where in df1 i have a partial string(address_id), and in dataframe 2 i have the same information but concatenate with another (concat_address_id).
I tryed several ways to merge, extract strings, preprocessing strings, check a list thta contains partial string match. However dont find a smart way to do what i need as in sample below, that is merge dataframes based in substrings match.
This is df1:
process sku qty address_id customer country
process1 sku1 1 address1 customer5 BR
process1 sku2 1 address2 customer5 BR
process1 sku3 1 address3 customer5 BR
process1 sku4 1 address4 customer5 BR
process1 sku5 1 address5 customer5 BR
This is df2.
concat_address_id last_login country_of_login
address1address5 15/10/2020 CN
address6address2 18/02/2020 NL
address3address5 13/05/2019 BR
address6address4 18/06/2020 NL
address5address8 13/05/2019 RU
And this is the expected result.
Expected Result:
process sku qty address_id customer country last_login country_of_login
process1 sku1 1 address1 customer5 BR 15/10/2020 CN
process1 sku2 1 address2 customer5 BR 18/02/2020 NL
process1 sku3 1 address3 customer5 BR 13/05/2019 BR
process1 sku4 1 address4 customer5 BR 18/06/2020 NL
process1 sku5 1 address5 customer5 BR 13/05/2019 RU