Your car is almost certainly the largest depreciating asset you’ll ever buy. Unfortunately, the resources available to consumers to help inform their car buying decision have serious limitations: they are often human-curated, feature a small subset of what’s available, and do not support their claims with data. As a Data Science Fellow at Insight Data Science, I used Autotrader listings to develop an app that maps out car depreciation costs across hundreds of models and makes a recommendation to the user that will minimize their costs and maximize their satisfaction.
Website: www.dealsonwheels.live
Slides: Google Slides
-
scrape_web.py
: uses Requests to connect to Autotrader, html to get web content, and Pandas to clean and store scraped content as a dataframe -
clean_data.py
: these files load .csv files, concatenate dataframes, pull out data of interest, rename/reorder columns, and remove spurious listings.
analyze_data.py
: these files pull .csv file with listing information, create histogram and scatter plots, fit price data to car age and mileage across all make/model combinations, and plot 2D and 3D depreciation curves and box plots.
-
views.py
: loads listing data and defines @app.route functions for /index, /models, /output, /random, and /about web pages. -
.flaskapp/flaskexample/templates/
: contains html template files for the web pages listed above.
Written by Michael Boles in February 2020 with help from the Insight and StackOverflow communities.