Towards Data Science | Medium

How to Make Proximity Maps with Python

In this data science project, we use Python to create "distance from" maps for college football teams in the Southeastern Conference (SEC). We find which team has to make the longest trips, on average, to play other teams, and which has the shortest trips. We then contour up these distances on a map of the southeastern US. The code starts by importing necessary libraries, including NumPy, Matplotlib, pandas, geopandas, and geopy. It then loads data for the SEC schools with their coordinates, creates a grid of points for interpolation, calculates distances from the specified school to every point in the grid, creates a color-filled contour map, adds state boundaries, and adds labels for the schools. Finally, the code calculates average distances between each school and the others, finds the school with the shortest and longest average distances, and creates a bar chart to visualize these distances.
favicon
towardsdatascience.com
towardsdatascience.com