I\'m writing a small program and to improve efficiency, I need to be able to find the closest latitude and longitude in my array.
Assume you have the following code:
Also u can simple do:
import mpu def distance(point1, point2): return mpu.haversine_distance(point1, point2) def closest(data, this_point): return min(data, key=lambda x: distance(this_point, x))