Kenya road accidents analysis using Python, Pandas, Matplotlib, and real-world accident data.
# Kenya Road Accident Analysis
A Python data analysis project that explores road accident data in Kenya for the years **2016** and **2017**. The project focuses on cleaning, combining, profiling, and visualizing accident records to uncover patterns that could support road safety awareness and data-driven decision-making.
## Project Objectives
The main objectives of this project are to:
- Clean and preprocess raw accident data.
- Merge datasets from multiple years into a single dataset.
- Standardize inconsistent column names.
- Handle missing values and duplicate records.
- Perform exploratory data analysis (EDA).
- Visualize accident trends across counties and victim categories.
- Export a cleaned dataset for future analysis.
## Dataset
The dataset contains road accident records reported in Kenya for the years **2016** and **2017**.
### Features include:
- Date of accident
- County
- Road
- Place
- Victim type
- Gender
- Age
- Accident description
- Other accident-related information
## Technologies Used
- Python
- Pandas
- NumPy
- Matplotlib
## Data Cleaning Process
The following preprocessing steps were performed:
- Loaded accident records from two Excel worksheets (2016 and 2017)
- Removed unnecessary columns
- Standardized column names
- Matched columns between both datasets
- Combined the datasets into one DataFrame
- Removed duplicate records
- Converted the date column to datetime format
- Extracted additional features:
- Year
- Month
- Day of the week
- Exported the cleaned dataset as a CSV file
## Exploratory Data Analysis
The analysis includes:
### 1. County Analysis
Identified the counties with the highest number of recorded accidents.
### 2. Victim Type Analysis
Examined the most common categories of accident victims.
### 3. Data Profiling
Generated descriptive statistics for numerical variables such as age and assessed missing values across the dataset.
## Visualizations
#### Top 10 Counties by Number of Accidents
#### Most Comm …