Python Data Cleaning Project Using SAPS 2024 Crime Stats
# SA Crime Data Cleaning - Python/pandas
## Overview
A data cleaning project using SAPS (South African Police Service)
crime statistics 2024. The raw Excel data contains merged headers,
inconsistent naming, and unnamed columns unsuitable for analysis.
This project documents the full cleaning pipeline and produces a
tidy dataset ready for dashboarding or modelling.
## Skills Demonstrated
- Real-world messy data handling (merged cells, unnamed columns)
- Dropping empty columns and standardising column names
- Missing value strategy and documentation
- Reproducible notebook structure with Markdown cells explaining
each decision
## Tools
Python 3 · pandas · matplotlib · Jupyter Notebook
## Data Source
SAPS Crime Statistics 2024 - saps.gov.za (publicly available)
## Key Finding
1. Eastern Cape recorded the highest number of crime records in the dataset.
2. Several formatting issues in the raw SAPS Excel file prevented immediate analysis.
3. Cleaning the data required removing unnamed columns, standardising headers, and handling missing values.
4. The final dataset is analysis-ready and can be used for Power BI dashboards or further statistical analysis.
## Visualisation
### Crime Records by Province
## Recommendations
1. Eastern Cape resource allocation: Eastern Cape had the
highest volume of crime records in the dataset. Government
should prioritise SAPS resource allocation; personnel,
vehicles and funding, to Eastern Cape stations
particularly in high-density districts.
2. Data quality improvement: The raw SAPS dataset contained
over 1,235 empty columns and inconsistent station naming.
SAPS should invest in standardised data collection systems
across all stations to enable faster and more reliable
national reporting.
3. Population-adjusted reporting: Raw record counts favour
larger provinces. Future SAPS publications should report
crime rates per 100,000 people rather than absolute counts
to allow fair provincial comparisons.
4. Station-level targeting: A c …