Penn State Football Recruit Map (2014-2024)

The notebook below is a simplified example of how to scrape several years of data and plot it on a map solely using python. It collects data from a college football recruiting website for the years 2014 through 2023 plotting each hometown. The output can be stylized just as you would any other webmap however since that wasn't the focal point here it's kept generic only changeing the baselayer and circle color.

Make sure the required libraries are installed

Import the modules that will be utilized

Initialize functions to be used later on

Loop through the years you'd like to collect the data for while scraping it along the way. Requests will grab all available data and Beautiful Soup will target specific sections that'll be parsed and added to a dictionary

Convert the dictionary of dictionaries to a GeoDataFrame (since we're using GeoPandas). It'll look funny as it comes in with the indexes flipped

In order to correct that, transpose it (.T) to get the uuid as the first column index. Take another look

Geocode those results

Attach the newly acquired spatial data to your DataFrame

Check out the GeoDataFrame and notice that you now have spatial data associated with each record

Utilize Folium to see the results on an interactive map directly in the notebook

See if there's a trend in anticipated class strength using the rankings. Group by the year and take the mean in this case

Plot it using GeoPandas Matplotlib extension