I have a two dataframes. One with a coordinates of sites, the other with with connections between them. For example:
df1:
SITE_ID LAT LON
101 23.4244 31.5356
102 45.0090 14.2424
103 35.3444 19.4242
104 42.0000 18.0002
df2
SITE_ID FIRST SECOND THIRD
101 102 104 NaN
102 103 NaN NaN
103 104 NaN NaN
104 NaN NaN NaN
Now I wanna to change all value(in all columns) in df2 with coordinates from df1. Desired output:
SITE_ID FIRST SECOND THIRD
23.4244 31.5356 45.0090 14.2424 42.0000 18.0002 NaN
45.0090 14.2424 35.3444 19.4242 NaN NaN
35.3444 19.4242 42.0000 18.0002 NaN NaN
42.0000 18.0002 NaN NaN NaN
It's ok to have a little variation on this white comma or putting in lists. Later I'm gonna transform this to json and use it with javascript google maps api.. To be honest, I don't have so much idea, I've tried with transforming into dict, or overwrite while merging, but nothing really works till the end.