Member-only story
Create a distance matrix in Python with the Google Maps API
Use the google maps API to obtain distances and duration between locations
2 min readAug 6, 2020
What you will learn in this article
- How to calculate the actual duration and distance according to google maps
- How to export your results in a clean excel
- How to iterate over each possible combination
Give a clap if you liked this article.
Step 0: Environment preparation
Install the googlemaps package & import pandas & itertools.
Step 1: Load the data
For learning purposes, I have created a dummy dataset. You can download the dataset here.