I'm new to python and I tried searching but could not find a solution.
I have two dataframes with Cartesian coordinates.
node x y value
abc 645 714 8
def 187 754 11
location x y value
ijk 621 744 1
lmn 202 720 -5
I want to find the minimum distance of each location in df2 with nodes in df1 and update "value" in df1.
I have seen cdist to calculate the minimum distance, but how do I link that back to the corresponding? node
Since ijk is close to abc and lmn to def, the final answer should be
node x y value
abc 645 714 9
def 187 754 6