I have a problem to solve in my pandas dataframe with Python3. I have two dataframes - the first one is as;
ID Name Linked Model 1 Linked Model 2 Linked Model 3
0 100 A 1111.0 1112.0 NaN
1 101 B 1112.0 1113.0 1115.0
2 102 C NaN NaN NaN
3 103 D 1114.0 NaN NaN
4 104 E 1114.0 1111.0 1112.0
the second one is;
Model ID Name
0 1111 A
1 1112 A,B
2 1113 C
3 1114 D
4 1115 Q
5 1116 Z
6 1117 E
7 1118 W
So the code should look up the value in - for instance in Linked Model 1 column and find the corresponding value in Name column in the second dataframe so that the ID can be replaced with name just like as shown in the result;
So as you can see in the result output, None stays as None (could be replaced numpy N/As) and the names from the second dataframe are now replaced with their corresponding Model IDs in the first dataframe.
I am looking forward to hearing your solutions!
Thanks

replaceproblem .