Skip to content

Fictioknox/EDA-of-crime-dataset-with-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

🕵️ Crime Data Exploratory Data Analysis (EDA) 🗺️

Welcome to the Crime Data EDA project! In this analysis, we dive into a dataset filled with crimes, uncovering key trends and insights that can help us better understand patterns of criminal activity. From visualizing the most common offenses to exploring crime hotspots, this EDA sheds light on how crime fluctuates across time and location. Ready to uncover the data mysteries? Let’s get started!

⚡ Tools Used:


Pandas & NumPy: For data manipulation and transformation.
Seaborn & Matplotlib: For creating insightful visualizations like bar charts and heatmaps.
Jupyter Notebook: For executing and documenting the analysis.

1. 🎯 Purpose of the Analysis

The aim of this analysis is to:

Identify common and rare crimes based on offense types and descriptions.
Explore patterns of crime based on time (hour, day, month, and year).
Analyze geographic trends by district and reporting areas.
Use visualizations to represent complex crime patterns clearly.

2. 📋 Understanding the Data

The dataset contains information about crime incidents, such as:

INCIDENT_NUMBER: A unique identifier for each crime.
OFFENSE_CODE and OFFENSE_DESCRIPTION: Describes the crime.
DISTRICT and STREET: Location-based information for each incident.
OCCURRED_ON_DATE: The date and time when the crime took place.
Lat and Long: Coordinates of the crime.
SHOOTING: Whether a shooting was involved in the crime.

Data Shape:
Total rows: 319,050
Columns: 17

3. 🔧 Challenges Faced

Working with real-world data is always tricky! Here’s how we tackled the challenges:

Handling Missing Data: Columns like "SHOOTING," "Lat," and "Long" had missing values. We either dropped or filled them as necessary.
Data Transformation: Converted date columns into datetime format for easier analysis.
Duplicates: Removed 23 duplicate records to ensure clean data.
Encoding: Tested different encodings to correctly read the dataset without errors.

4. 📈 Key Performance Indicators (KPIs)

To get an overview of the crime data, we focused on these KPIs:

Most Common Offense Groups: Identify the crime categories that happen the most.
Least Common Offense Groups: Crimes that rarely occur, such as human trafficking.
Crime Trends by Year, Month, and Day: Analyze how crimes change over time.
Crime Hotspots: Which districts and streets see the most crime.
Hourly Crime Patterns: When are crimes most likely to occur during the day?

5. 🔍 Detailed Analysis & Insights


🏆 Most Common Crimes:
Motor Vehicle Accident Response is the most common crime, making up 11.6% of all incidents.
Recommendation: Focus on traffic management and safety to reduce motor vehicle incidents.

🔬 Least Common Crimes:
Human Trafficking - Involuntary Servitude and Biological Threat are among the rarest, with just 2 incidents each.

📅 Crime Trends by Year:
2017 had the highest number of crimes (100,884), while 2018 saw a decline (65,685 incidents).
Recommendation: Investigate why crime declined in 2018 to replicate successful strategies.

🕑 Crime by Day and Hour:
Friday is the busiest day for crime, followed by Wednesday and Thursday.
Crimes peak during the afternoon and evening hours (12–6 PM).
Recommendation: Increase police presence on Friday afternoons and evenings to deter crime.

📊 District-Wise Heatmap:
The districts B2 and D4 report the most crimes.
Recommendation: Focus law enforcement efforts in these districts to improve safety.

6. 🎯 Creative Business Insights


Actionable Insights for Crime Prevention:
Targeted Policing: Focus on high-crime districts like B2 and D4, especially during peak crime hours.
Traffic Safety Programs: Reduce vehicle accidents, which are the most common type of crime.
Community Engagement: Since crimes are less common on Sundays, this could be a good day for community-building events.

About

crime data eda with python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published