A comprehensive analysis of vehicle fuel economy trends using EPA data from 2008 and 2018. This project explores fuel efficiency improvements, alternative fuel adoption, and characteristics of eco-friendly vehicles.
- Are more models using alternative fuels? By how much?
- How have vehicle classes improved in fuel economy?
- What characterizes SmartWay vehicles?
- What features correlate with better fuel economy?
- Which 2008 model showed the greatest MPG improvement by 2018?
- Source: EPA's National Vehicle and Fuel Emissions Lab
- Years Analyzed: 2008 vs 2018
- Original Features:
- Engine specifications (displacement, cylinders)
- Fuel type (Gasoline, Diesel, Ethanol, etc.)
- MPG metrics (City, Highway, Combined)
- Environmental scores (Air Pollution, Greenhouse Gas)
- SmartWay certification
# Key Cleaning Steps
fe_08 = fe_08.dropna().drop_duplicates()
fe_18 = fe_18.dropna().drop_duplicates()
# Fixing data types
fe_08['cyl'] = fe_08['cyl'].str.extract('(\d+)').astype(int)
fe_18['cyl'] = fe_18['cyl'].astype(int)
# Handling hybrid vehicles
hb_08 = fe_08[fe_08['fuel'].str.contains('/')]
# ... (complex splitting logic for hybrid metrics)| Year | Unique Alternative Fuel Models | Proportion of Total |
|---|---|---|
| 2008 | 2 | 0.5% |
| 2018 | 26 | 7.3% |
| Vehicle Class | MPG Improvement (2008-2018) |
|---|---|
| Large Cars | +4.9 |
| Midsize Cars | +6.3 |
| Pickups | +2.3 |
- Avg Engine Size: 1.79L vs 2.6L in 2008
- Avg Combined MPG: 37.4 vs 23.7 in 2008
- Common Features: Smaller engines, hybrid systems, aerodynamic designs
Volvo XC 90 achieved the largest MPG improvement:
- 2008: 15.7 MPG → 2018: 32.2 MPG (+104% improvement)
plt.scatter(fe_18['displ'], fe_18['cmb_mpg'])
plt.title('Engine Size vs Fuel Efficiency (2018)');- Clone repo:
git clone https://github.com/yourusername/fuel-economy-analysis.git
- Install requirements:
pip install -r requirements.txt
- Run Jupyter notebook:
jupyter notebook fuel_economy_analysis.ipynb
├── Data/
│ ├── fe_08_cleaned.csv
│ └── fe_18_cleaned.csv
├── Images/
├── fuel_economy_analysis.ipynb
├── README.md
└── requirements.txt
Contributions welcome! Please open an issue first to discuss proposed changes.
EPA data files are public domain. Code licensed under MIT License.
Let's drive towards a more fuel-efficient future! 🌱

