difference between multiple points from longitude and lattitude in python

Viewed 30

I have a dataset containing three column store number, longitude, and latitude. multiple longitude and latitude are there, the image showing just a few values.

enter image description here

here are the questions:

a) Which store has the farthest distance to its nearest neighboring store? b) What percent of stores are within 1km of another store? c) What percent of stores are within 3km of another store? d) What percent of stores are within 5km of another store? e) Which store has the most other stores within 10km?

1 Answers

This is not the complete answer, however it is a good place to start: In order to answer these questions, we typically use the haversine function which computes the distance between two points on a spherical projection. There is already a library where all you have to do is to load your data as a dataframe for example with pandas. This might be of help for you : haversine

Related