CoolFace
Datasetpublic

Yoad22/craigslist-used-cars-eda

Craigslist Used Cars and Trucks: EDA Overview This dataset and notebook contain an Exploratory Data Analysis (EDA) of real Craigslist used-car listings scraped across the United States. Main Question: What factors most influence the price of a used car listed on Craigslist? Target Variable: price — the seller's asking price for each vehicle listing. About the Dataset Property Details Source Kaggle — Austin Reese (scraped from Craigslist)… See the full description on the dataset page: https://huggingface.co/datasets/Yoad22/craigslist-used-cars-eda.

sourceHugging Facecc-by-4.0updated 5mo agoView on Hugging Face
0likes150downloads
Dataset Card

Craigslist Used Cars and Trucks: EDA

<video src="https://huggingface.co/datasets/Yoad22/craigslist-used-cars-eda/resolve/main/EDA_video.mp4" controls="controls" style="max-width: 720px;"></video>

Overview

This dataset and notebook contain an Exploratory Data Analysis (EDA) of real Craigslist used-car listings scraped across the United States.

Main Question: What factors most influence the price of a used car listed on Craigslist?

Target Variable: price — the seller's asking price for each vehicle listing.

About the Dataset

PropertyDetails
SourceKaggle — Austin Reese (scraped from Craigslist)
Original Size~426,000 rows x 26 columns
ContentUsed car and truck listings across the United States
Target Variableprice — the asking price of the vehicle

Features include: year, manufacturer, condition, cylinders, fuel, odometer, transmission, drive, type, paint_color, state, and more.

Repository Contents

FileDescription
vehicles_clean.csvCleaned dataset after all preprocessing steps
Craigslist_Used_Cars_EDA_Final.ipynbFull EDA notebook (Google Colab)
README.mdThis file
presentation.mp42-3 minute video walkthrough

Part 1: Data Cleaning

Raw Craigslist data required substantial cleaning. Rather than a single blanket strategy, we matched each column to the approach that fits it best.

Columns Dropped

The following columns were removed as they add no value to price analysis:

ColumnReason
url, region_url, image_urlLinks, not useful for analysis
descriptionFree-text field, too complex to analyze in this EDA
VINUnique per car, no predictive signal
countyAlmost entirely empty
posting_dateNot in scope for this analysis
regionReplaced by state for geographic analysis
lat, longGeographic coordinates, redundant with state

Two columns (id and model) were kept temporarily through the relevant cleaning steps and dropped only once their job was done: id protected against false duplicates during deduplication, and model enabled the manufacturer recovery described below.

Missing Values Strategy

StrategyApplied To
Drop column (>50% missing)Columns with more than half their values missing
Drop rowRows missing price, year, or odometer
Smart Manufacturer RecoveryUse model to recover missing manufacturers before falling back to unknown
Smart Cylinder RecoveryFill missing cylinder values by (manufacturer, model) first, then (manufacturer, year), then manufacturer, then median
Generic median fallbackSafety net for any remaining numeric NaNs

Smart Manufacturer Recovery

Filling every missing manufacturer with unknown would create a large fake brand that pollutes later analysis. Instead, we build a lookup from rows where both model and manufacturer are present, then use it to recover manufacturers when only the model is known. For example, a listing with model = civic becomes a Honda; model = f-150 becomes a Ford. Only rows missing both fields fall back to unknown.

The model column is kept alive for now because it is also used in the Smart Cylinder Recovery step below.

Smart Cylinder Recovery

The cylinders column is filled in four passes, from most specific to least specific:

  1. 1.Most common cylinder count for each (manufacturer, model) pair — the most reliable match, since a given model is very consistent on cylinders regardless of year.
  2. 2.Most common cylinder count for each (manufacturer, year) pair, for rows still missing.
  3. 3.Most common cylinder count for the manufacturer alone, as a further fallback.
  4. 4.Overall median, as a final safety net.

This hierarchy produces much more realistic values than a single dataset-wide median. After this step, the model column has finished its job (helping recover both manufacturer and cylinders) and is dropped.

Unrealistic Value Filters

ColumnFilterReasoning
price500 to 150,000 dollarsRemoves free and erroneous listings while preserving legitimate budget and luxury markets
year1990 to 2026Realistic range of used cars in active circulation
odometerLess than 400,000 milesAbove 400K is almost certainly a data entry error

Smart Duplicate Detection

Because we dropped id and VIN, the default duplicate check could incorrectly merge two genuinely different listings. We keep id through the dedup step, then identify re-posts by matching across nine content fields: price, year, manufacturer, odometer, state, condition, cylinders, fuel, paint_color. Matching all nine by coincidence is implausible, so we treat such pairs as the same car posted twice. id is dropped right after this step.

Outlier Detection

After the unrealistic-value filter, we apply IQR-based outlier removal to price:

  • —Lower bound = Q1 - 1.5 × IQR
  • —Upper bound = Q3 + 1.5 × IQR

Before/after box plots confirm the distribution becomes much cleaner.

Feature Engineering

A new column car_age was created from the year column:

car_age = 2026 - year

Part 2: Research Questions and Visualizations

Guiding question: What factors determine the price of a used car on Craigslist?

Question 1: What does the price distribution look like?

Price Distribution

Insight: The distribution is right-skewed. Most cars are priced at lower values, but a long tail of more expensive vehicles pulls the mean above the median. This is typical of used car markets, where a few luxury or collector cars co-exist with many affordable listings.

Question 2: Which manufacturers are most commonly listed?

Most Common Manufacturers

Insight: American brands — Ford, Chevrolet, GMC, Dodge — dominate Craigslist listings. This reflects their popularity in the US market and the sheer volume of American used cars in circulation.

Question 3: Which manufacturers have the highest average prices?

Average Price by Manufacturer

Insight: Even among the most-listed brands, there is a meaningful spread in average price. Brands like GMC and Ram tend to skew higher, largely due to trucks, while others cluster at lower price points. Brand alone is already a useful signal of expected price range.

Question 4: How does vehicle condition affect price?

Price by Vehicle Condition

Note: the unknown category is excluded from this plot, since it dominates the count as a fallback fill for missing conditions and would obscure the pattern across real condition values.

Insight: Condition is one of the strongest price signals in the dataset. "New" and "like new" vehicles command the highest prices, while "salvage" cars are the cheapest. Salvage cars have been in accidents and written off by insurance companies, significantly reducing their market value.

Question 5: Is there a relationship between odometer reading and price?

Odometer vs Price

Insight: There is a clear negative correlation between odometer and price. More miles means lower price, exactly as expected from the used-car market. The scatter plot also reveals high variance at low odometer readings, meaning newer low-mileage cars vary much more widely in price than high-mileage ones.

Question 6: Does fuel type influence price?

Listings by Fuel Type

Average Price by Fuel Type

Insight: Gas cars dominate in quantity, but diesel and electric vehicles carry clear price premiums. Diesel engines are mostly found in trucks and commercial vehicles, which ties back to our drivetrain finding that 4WD vehicles are the priciest. Electric vehicles belong to a newer and generally higher-trim market segment, which explains their elevated average price.

Question 7: How does car age relate to price?

Average Price by Car Age

Insight: There is a clear downward trend. As cars get older, their average price falls. There are interesting bumps at very high ages (30 to 35 years): these are classic cars, which can spike in price, revealing a small but real collector-car market even on Craigslist.

Question 8: Does drive type affect price?

Price by Drive Type

Insight: 4WD vehicles have the highest median price, followed by RWD, then FWD. 4WD is common in trucks and SUVs, and RWD is typical in luxury and sports cars. FWD sedans and hatchbacks dominate the lower price range.

Question 9: What do the numeric correlations look like overall?

Correlation Heatmap

Key Observations:

PairCorrelationMeaning
year and pricePositiveNewer model year means higher price
car_age and priceNegativeOlder car means lower price
odometer and priceNegativeMore miles means lower price
cylinders and pricePositiveMore cylinders means bigger engine and higher price
year and car_ageStrong Negative (near -1)Expected, they are mathematically inverse

All correlations match domain intuition, which gives confidence that the cleaned data is solid.

Summary of Findings

FactorKey Finding
Price DistributionRight-skewed. Most cars are affordable; a few luxury cars inflate the mean
Top ManufacturersFord and Chevrolet dominate listings; GMC and Ram command the highest average prices
Vehicle ConditionOne of the strongest signals. New and like-new cars cost significantly more
OdometerClear negative correlation. More miles means lower price
Fuel TypeDiesel and electric vehicles are priced higher on average
Car AgeStrong negative relationship. Older cars are cheaper, with rare classic car price spikes
Drive Type4WD vehicles are the most expensive on average
CorrelationsYear, odometer, car_age, and cylinders all correlate meaningfully with price

Conclusion: Used car pricing on Craigslist is driven by a combination of factors. Condition, age, mileage, and drivetrain are the strongest individual signals.

Used Car Price Calculator

As a practical application of the EDA findings, the notebook includes a simple price calculator. Given five inputs (manufacturer, year, odometer, condition, drive type), the calculator finds similar listings in the cleaned dataset and returns an estimated price, a typical price range, and a qualitative confidence level (High, Medium, or Low) based on how many similar cars were found and how consistent their prices are.