In pseudocode (not language specific and VERY loosely typed):
function getDistance(point pointA, point pointB){
diffx = absoluteValue(pointA.x - pointB.x);
diffy = absoluteValue(pointA.y - pointB.y);
return squareRoot(diffx^2 + diffy^2)
}
for point1 in df1{
//each obj stores a point and a corresponding distance
Object distance{
point2Identifier;
distanceFromPoint1;
}
ObjectArray distances; //Array of distance objects
for point2 in df2{
distances.add(getDistance(point1, point2));
}
distances.getSmallest /*Finds the distance obj with the smallest distanceFromPoint1 prop and stores it however you see fit*/
}
This was off the top of my head and quickly typed, so simplification and implementation are up to you. This most likely is not the quickest nor the most efficient way of achieving what you want. I am sure it can be simplified greatly, especially in Python. As you probably know, the API is littered with methods for simplifying math-in-code.