Skip to content
Research · Data Analytics

LAPD Crime Analytics

Analysis of 1 million Los Angeles police records with methodological rigor.

https://lapd-data-crime.vercel.app/dashboard
LAPD Crime Analytics — lapd (screenshot 1 of 1)
1M+

Records processed and normalized

20.1%

LAPD case resolution rate

26.2%

Share of violent crime

Context

The LAPD has published its crime data openly since 2020 — more than 1 million records with dates, locations, offense types, suspect demographics, and case status. The problem: it's all raw CSV, with no tool to explore it.

The Challenge

Turn 1M+ tabular records into an interactive analysis system that surfaces spatial, temporal, and demographic patterns. The methodological challenge was category normalization — the LAPD uses 120+ crime types with inconsistent naming — and geocoding the locations.

My Role

Data analyst and full developer: ETL pipeline design, exploratory data analysis (EDA), category normalization, Next.js dashboard development, D3.js visualization implementation, and production deployment.

Approach

A 3-stage pipeline: (1) Ingestion and cleaning in Python/Pandas — normalizing dates, coordinates, categories, and null values; (2) Analysis and feature engineering — aggregations by zone, hour, crime type, and demographics; (3) A Next.js API serving the pre-processed data with dynamic filters. The Arrests module is a separate analysis over the arrests sub-dataset.

Stack — why each technology

Python + PandasRobust ETL for 1M+ rows; Pandas' vectorized operations are 100x faster than loops
Next.js + TypeScriptDashboard with complex filters and shared state; TypeScript is a must given the schema's complexity
D3.jsThe custom visualizations (heatmaps, treemaps, timelines) don't exist in off-the-shelf libraries
VercelInstant deployment with edge functions for the dynamic-filter endpoints
GeoJSON + LeafletVisualizing geo-referenced crimes by zone; lightweight and performant for 100k+ points with clustering

Key Decisions

Pre-process vs. process in real time

With 1M+ records, real-time queries over the raw CSV are unacceptably slow. I chose to pre-process the most common aggregations (by hour, day, zone, type) and serve them from pre-computed endpoints. Complex queries use the API, but against already-normalized data.

Arrests module as a separate section

Arrest data has a different structure from the crime reports (it includes the arrestee's demographics). Folding it into the main dashboard would have complicated it unnecessarily. A separate module allows for specific analysis without contaminating the crime analysis.

Normalizing 120+ categories into 8 macro-categories

The LAPD uses an inconsistent taxonomy with 120+ crime types. Without normalization, analysis by type is useless. I defined 8 macro-categories (Violent, Property, Drugs, Weapons, Traffic, Persons, Fraud, Other) with explicit, documented assignment rules.

Results

Dashboard live on Vercel with public access. The macro-level analysis revealed that violent crime accounts for 26.2% of the total with an upward trend, that peak hours are 12–2pm (not nighttime, as popular imagination suggests), and that the 20.1% resolution rate varies significantly by crime type.

What I Learned

Open data isn't clean data. I spent 60% of the time on ETL and only 40% on visualizations. I also learned that methodological decisions (how to normalize categories, what to do with null values) matter as much as the code, if not more — they change the conclusions. Documenting those decisions is part of the job.

A project like this for your organization?

Tell me the problem and we'll work out how to solve it with data.

Let's talk

Next case

Yerba Mate Intelligence →

View case