I have two DataFrames: 1st one contains around 10k lines with coordinates 2nd contains around 2 million lines with coordinates and associated with them information.
I need to compare these 10k of coordinates in df1 to the big 2 million list of df2, find closest coordinate match and copy the information from the matching row in df2 to df1.
All solutions I could think of so far would requite me to use iteration which would take a very long time. Is there any more time efficient way to do this?
Here is an example of the inputs:
>>> df1
name lat long
1 a 51.5068 -0.0733794
>>> df2
lat long value
1 51.078541 -0.066799 1000
2 55.056743 -2.127532 50
After the execution I need to get an output like that
>>> df1
name lat long value
1 a 51.5068 -0.0733794 1000