A data analysis project exploring 13,201 civic complaints filed by New York City residents across 5 boroughs over 16 years — uncovering patterns in housing, homelessness, noise, sanitation, and agency performance.
1. Heating is NYC's #1 Problem 18.8% of all complaints — nearly 1 in 5 — are about heating failures. Concentrated in the Bronx, pointing to systemic landlord enforcement gaps.
2. Economic Development Corporation Takes 725 Days to Close Complaints The slowest agency averages nearly 2 years per complaint resolution. The fastest (3-1-1 Call Center) closes in under 1 hour — a 725-day gap.
3. 139 Complaints Are Still Unresolved Open complaints spanning years suggest a systemic backlog in certain agencies.
4. Midnight Data Spike is a Quality Issue 297 complaints logged at midnight on Tuesdays — almost certainly batch-logging by city systems, not real citizen reports. Flagged as a data quality artifact.
5. 2018 Manhattan Homeless Anomaly — Root Cause Found 211 homeless complaints filed in 2018, all from Manhattan, 99.5% via mobile app, concentrated June–October. Pattern strongly suggests organised field reporting by a city outreach team rather than organic citizen complaints. These records should be tagged separately in any longitudinal analysis.
6. Brooklyn Has the Most Complaints — But Different Problems Per Borough
| Borough | #1 Complaint |
|---|---|
| Manhattan | Homeless Person Assistance |
| Brooklyn | Blocked Driveway |
| Bronx | Heating |
| Queens | Bulky Item Collection |
| Staten Island | Street Condition |
- Source: NYC Open Data — 311 Service Requests
- Records: 13,201 rows across 5 files
- Period: 2010 – 2026
- Columns: 44 fields including complaint type, agency, borough, dates, location
| Issue | Description | Fix Applied |
|---|---|---|
| Duplicate complaint names | HEAT/HOT WATER vs HEATING, PAINT - PLASTER vs PAINT/PLASTER |
Standardised via mapping dictionary |
| Case inconsistencies | UNSANITARY CONDITION vs Unsanitary Condition |
.str.title() normalisation |
| City field mess | Ridgewood vs RIDGEWOOD, NEW YORK for Manhattan |
.str.title() normalisation |
| 100% empty columns | 7 columns completely null (bridge/taxi/vehicle fields) | Dropped from analysis |
| Date stored as strings | 12/28/2019 04:55:28 PM format |
Parsed to datetime, extracted year/month/hour |
| Midnight batch logging | 297 complaints at hour 0 on Tuesdays | Flagged as data artifact |
| 2018 homeless spike | 211 Manhattan mobile complaints June–Oct | Flagged as field survey data |
- Complaint volume trends (2010–2026)
- Agency resolution time benchmarking
- Borough-level complaint breakdown and inequality analysis
- Temporal heatmap (hour of day vs day of week)
- Pre-COVID vs Post-COVID complaint comparison
- Homeless complaint longitudinal trend
- Anomaly detection and root cause analysis
| Chart | Insight |
|---|---|
| Top 12 Complaint Types | Heating dominates at 18.8% |
| Resolution Time by Agency | EDC at 725 days is an outlier |
| Complaints per Year | Trend across 16 years |
| Day vs Hour Heatmap | Midnight spike reveals data quality issue |
| Borough Comparison | Volume + resolution time side by side |
| Top 5 per Borough | Each borough has a distinct complaint profile |
| Pre vs Post COVID | Shift in complaint types after 2020 |
| Homeless Trend | 2018 anomaly isolated to Manhattan mobile reports |
- Python 3.14
- Pandas — data cleaning and analysis
- Matplotlib / Seaborn — static visualisations
- Plotly — interactive charts
- Jupyter Notebook — analysis environment
- Antigravity (VS Code) — IDE
# 1. Clone the repo
git clone https://github.com/YOUR_USERNAME/nyc-311-analysis.git
cd nyc-311-analysis
# 2. Install dependencies
pip install pandas matplotlib seaborn plotly openpyxl nbformat
# 3. Download data from NYC Open Data and place CSVs in the project folder
# 4. Open and run the notebook
# Open nyc_311_cleaning.ipynb in VS Code or Jupyter
# Click Run Allnyc-311-analysis/
├── nyc_311_cleaning.ipynb <- Main analysis notebook
├── 311_cleaned.csv <- Cleaned, merged dataset
├── borough_complaints_interactive.html <- Interactive Plotly chart
└── README.md <- This file
Built as a portfolio project to demonstrate real-world data cleaning, exploratory analysis, anomaly detection, and business insight generation using messy civic data.
Author: Merlin Location: Bengaluru, India Tools: Python, Pandas, Seaborn, Plotly