top of page
  • Soham Shinde

Calculating Air Distance Between USA Cities for Finding Shortest Route

Hello Friends, I have completed a project in which I have used python to find the shortest air distance. Logistics and supply chain is very time sensitive, if there is delay in the shipment, it can affect the other nodes in the supply chain. There is high chance that final customer will receive the package/product late.


This blog will help the logistics business to use this matrix in real life to find which is the route they must follow, if the shipment is going via airplane. I have followed these steps:

1. Problem statement- Finding the air distance


2. Importing libraries like pandas, NumPy


3. Importing data with pd.read()


4. Reading data with pd.DataFrame()


5. Converting latitude and longitude to radians


6. Importing the Haversine distance from SciKit learn


7. Used pairwise function to make pair of distance between each city


8. Converted name of city to List


9. Used pd.DataFrame to make final Data Frame


10. Final Distance matrix


I have noted the code in Github repository. Please have a look at the code and matrix. This is a small matrix which can help to find the air distance between USA cities.


Thank You,

Soham S Shinde

18 views0 comments
bottom of page