Hi I have 2 dataframes where i have to use 1 dataframe to replace the value in other. I can normally create the dictionary to replace values in whole dataframe but I have a bit different value in other dataframe so i need condition where i can tell if the part of the string is matched then it should map the dictionary. The first dataframe is like this:
The second dataframe is like this:
id cars1 cars2
1 $ {hQOpelText.r1.val} BMW
2 $ {hQOpelText.r2.val} $ {hQOpelText.r2.val}
3 $ {hQOpelText.r3.val} $ {hQOpelText.r5.val}
4 $ {hQOpelText.r4.val} Audi
5 $ {hQOpelText.r5.val} Audi
And i want resulted df like this:
id cars1 cars2
1 Opel Adam BMW
2 Opel Astra Estate Opel Astra Estate
3 Opel Astra Hatchback Opel Grandland x
4 Opel Astra Saloon Audi
5 Opel Grandland x Audi