File size: 13,899 Bytes
cd217ee | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | ---
license: mit
---
# ποΈ NYC Urban Indicators Dataset
[](https://geopandas.org)
[](https://pandas.pydata.org)
[](https://opendata.cityofnewyork.us)
[](https://opensource.org/licenses/MIT)
[](https://huggingface.co/datasets/alidenewade/nyc-urban-analytics)
> **π [Download Dataset](https://huggingface.co/datasets/alidenewade/nyc-urban-analytics)** | **πΊοΈ Geospatial Panel Data** | **π 7 Years of NYC Data** | **π Census Tract Level**
## π― A Geospatial Time-Series Panel for Census-Tract Level Analysis in New York City
This dataset provides a comprehensive, monthly panel of urban indicators for New York City at the census tract level, spanning from **January 2018 to December 2024**. It aggregates data from multiple public sources, including NYPD, NYC 311, and the Department of Buildings (DOB), making it ideal for urban analytics, predictive modeling, and socioeconomic research.

## β¨ Dataset Highlights
| Feature | Description | Value |
|---------|-------------|-------|
| π
**Temporal Coverage** | January 2018 - December 2024 | 7+ years |
| πΊοΈ **Spatial Resolution** | Census tract level (GEOID) | 2,168 tracts |
| π **Data Points** | Monthly observations per tract | 180,000+ records |
| π **Update Frequency** | Static historical dataset | Complete panel |
| π **Data Sources** | NYPD, NYC 311, DOB | Multi-agency |
## π Why This Dataset Matters
### π For Researchers & Academics
Created to facilitate the study of **urban dynamics** by providing a clean, merged, and canonicalized data source. Perfect for:
- **Spatial-temporal analysis** of urban patterns
- **Predictive modeling** of crime and service demands
- **Socioeconomic research** with neighborhood-level granularity
- **Policy impact assessment** through longitudinal analysis
### π For Data Scientists & Analysts
The data is structured as a **panel dataset**, with each row representing a unique combination of a census tract (GEOID) and a month. This structure is optimal for:
- **Time-series forecasting** of urban indicators
- **Machine learning** tasks like crime prediction
- **Geospatial analysis** and mapping applications
- **Cross-sectional comparisons** across neighborhoods
## π Dataset Structure
### Core Files
**π `nyc_cesium_features.parquet`** - Primary Panel Dataset
- **180,000+ observations** across 2,168 census tracts
- **84 monthly snapshots** from 2018-01 to 2024-12
- **Multi-dimensional indicators**: Crime, 311 requests, building permits
- **Optimized format**: Parquet for fast loading and analysis
**πΊοΈ `nyc_tracts.parquet`** - Geospatial Reference File
- **Census tract geometries** in Well-Known Text (WKT) format
- **2,168 unique census tracts** covering all NYC boroughs
- **EPSG:4326 coordinate system** for global compatibility
- **Ready for mapping**: Compatible with GeoPandas and mapping libraries
## π Data Schema & Variables
### π Primary Keys
- **`GEOID`**: 11-digit census tract identifier (e.g., "36061000100")
- **`month`**: Monthly timestamp (e.g., "2023-01")
### π¨ Crime Indicators (NYPD Data)
- **`crime_total`**: Total reported crimes per tract-month
- **`crime_felony`**: Felony-level crimes (most severe)
- **`crime_misd`**: Misdemeanor crimes (moderate severity)
- **`crime_viol`**: Violation-level crimes (least severe)
### π Service Requests (NYC 311 Data)
- **`sr311_total`**: Total 311 service requests
- **Top 10 Complaint Types** with individual counts:
- `Noise - Residential`
- `Illegal Parking`
- `Street Light Condition`
- `Water System`
- `And 6 more frequent complaint categories...`
### ποΈ Building Activity (DOB Data)
- **`dob_permits_total`**: Total Department of Buildings permits issued
- Includes construction, renovation, and building-related permits
## π οΈ Data Sources & Methodology
### π Primary Data Sources
All data sourced from **NYC Open Data Portal** with proper attribution:
| Source | Agency | Data Type | Update Frequency |
|--------|---------|-----------|-----------------|
| **NYPD Complaint Data** | Police Department | Crime reports by severity | Daily |
| **311 Service Requests** | Multiple agencies | Citizen service requests | Real-time |
| **DOB Permit Issuances** | Buildings Department | Construction permits | Daily |
### π Data Processing Pipeline
1. **Data Extraction**: Automated downloads from NYC Open Data APIs
2. **Temporal Aggregation**: Monthly summaries by census tract
3. **Spatial Mapping**: Geocoding and tract assignment
4. **Quality Assurance**: Missing value handling and outlier detection
5. **Standardization**: Consistent naming and data types
6. **Validation**: Cross-checking with official statistics
## π» Quick Start Guide
### Installation
```bash
pip install datasets pandas geopandas shapely matplotlib
```
### Basic Usage
```python
from datasets import load_dataset
import pandas as pd
import geopandas as gpd
from shapely import wkt
# Load the datasets from Hugging Face Hub
features_ds = load_dataset("alidenewade/nyc-urban-analytics",
split="train",
data_files="nyc_cesium_features.parquet")
tracts_ds = load_dataset("alidenewade/nyc-urban-analytics",
split="train",
data_files="nyc_tracts.parquet")
# Convert to pandas DataFrames
features_df = features_ds.to_pandas()
tracts_df = tracts_ds.to_pandas()
print(f"π Panel Data Shape: {features_df.shape}")
print(f"πΊοΈ Geographic Data Shape: {tracts_df.shape}")
```
## πΊοΈ Geospatial Analysis Example
### Prepare Geographic Data
```python
# Convert WKT strings to geometry objects
tracts_df['geometry'] = tracts_df['geometry'].apply(wkt.loads)
# Create GeoDataFrame
tracts_gdf = gpd.GeoDataFrame(tracts_df, geometry='geometry', crs="EPSG:4326")
```
### Crime Hotspot Analysis
```python
# Aggregate crime data for 2023
features_df['month'] = pd.to_datetime(features_df['month'])
crime_2023 = features_df[features_df['month'].dt.year == 2023]
crime_by_tract = crime_2023.groupby('GEOID')['crime_total'].sum().reset_index()
# Merge with geographic data
crime_map = tracts_gdf.merge(crime_by_tract, on='GEOID', how='left').fillna(0)
# Create choropleth map
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(15, 10))
crime_map.plot(column='crime_total',
cmap='viridis',
legend=True,
ax=ax)
ax.set_title('NYC Crime Density by Census Tract (2023)', fontsize=16)
plt.tight_layout()
plt.show()
```
## π Advanced Analysis Examples
### Time Series Analysis
```python
# Analyze crime trends for a specific tract
tract_id = "36061000100" # Example tract in Manhattan
tract_data = features_df[features_df['GEOID'] == tract_id].copy()
tract_data['month'] = pd.to_datetime(tract_data['month'])
tract_data = tract_data.sort_values('month')
# Plot time series
plt.figure(figsize=(12, 6))
plt.plot(tract_data['month'], tract_data['crime_total'], marker='o')
plt.title(f'Crime Trends - Census Tract {tract_id}')
plt.xlabel('Month')
plt.ylabel('Total Crimes')
plt.xticks(rotation=45)
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
```
### Service Request Analysis
```python
# Top 311 complaint types correlation with crime
correlation_data = features_df[['crime_total', 'sr311_total']].corr()
print("Crime vs 311 Requests Correlation:")
print(correlation_data)
```
## π― Use Cases & Applications
### ποΈ Urban Planning & Policy
- **Resource Allocation**: Identify high-need areas for police and city services
- **Infrastructure Planning**: Correlate building permits with service demands
- **Policy Evaluation**: Measure impact of interventions over time
- **Budget Optimization**: Data-driven allocation of municipal resources
### π Academic Research
- **Urban Sociology**: Study neighborhood dynamics and social patterns
- **Criminology**: Analyze crime patterns and environmental factors
- **Public Policy**: Evaluate effectiveness of urban interventions
- **Economics**: Research property values and neighborhood change
### π€ Machine Learning & Data Science
- **Predictive Modeling**: Forecast crime rates and service demands
- **Anomaly Detection**: Identify unusual patterns in urban data
- **Clustering Analysis**: Discover neighborhood typologies
- **Feature Engineering**: Create spatial-temporal variables
### π Business Intelligence
- **Risk Assessment**: Location-based risk modeling for insurance/real estate
- **Market Analysis**: Understand neighborhood characteristics for business decisions
- **Service Planning**: Optimize delivery routes and service coverage
- **Investment Research**: Data-driven real estate and development insights
## π Data Quality & Limitations
### β
Strengths
- **Comprehensive Coverage**: All NYC census tracts over 7 years
- **Multi-Source Integration**: Rich, multi-dimensional urban indicators
- **Temporal Consistency**: Standardized monthly aggregations
- **Spatial Precision**: Census tract level for detailed analysis
- **Clean Processing**: Automated QA/QC pipeline
### β οΈ Limitations & Considerations
- **Reporting Bias**: Crime data reflects reported incidents only
- **Temporal Lag**: Some data may have reporting delays
- **Spatial Accuracy**: Point-to-tract assignment may have edge cases
- **Missing Values**: Some tract-months may have zero observations
- **Seasonal Patterns**: Consider monthly variations in analysis
## π§ Technical Specifications
### File Formats & Sizes
- **Format**: Apache Parquet for optimal performance
- **Compression**: Snappy compression for fast I/O
- **Total Size**: ~50MB compressed
- **Memory Usage**: ~200MB when loaded in pandas
### Performance Optimizations
- **Columnar Storage**: Efficient querying and filtering
- **Data Types**: Optimized integer and float precision
- **Indexing**: Pre-sorted by GEOID and month
- **Compatibility**: Works with pandas, polars, and dask
## π€ Contributing & Feedback
We welcome contributions to improve this dataset! Here's how you can help:
### π Data Enhancement
- **Additional Variables**: Suggest new urban indicators to include
- **Quality Improvements**: Report data inconsistencies or errors
- **Methodology Feedback**: Propose better aggregation or processing methods
- **Documentation**: Improve variable descriptions and usage examples
### π§ Technical Contributions
- **Analysis Examples**: Share interesting use cases and code
- **Visualization Tools**: Create plotting utilities and templates
- **Performance Optimizations**: Suggest faster loading/processing methods
- **Integration Guides**: Help with other platforms and tools
## π Citation & Attribution
If you use this dataset in your research, please consider citing it as:
```bibtex
@misc{nyc_urban_analytics_2025,
author = {alidenewade},
title = {NYC Urban Indicators Dataset},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face Hub},
howpublished = {\url{https://huggingface.co/datasets/alidenewade/nyc-urban-analytics}}
}
```
## π License
This dataset is licensed under the **MIT License**, allowing for both academic and commercial use with proper attribution.
### License Summary
- β
**Commercial use** permitted
- β
**Modification and redistribution** allowed
- β
**Private use** permitted
- β **No warranty** provided
- β **Attribution** required
## π Related Resources
### π Interactive Dashboard
Explore this data interactively with our **NYC Urban Analytics Dashboard**:
- **π [Live Dashboard](https://huggingface.co/spaces/alidenewade/nyc-urban-analytics)**
- **π€ ML Predictions**: Real-time crime risk classification
- **π Time Series**: SARIMAX forecasting capabilities
- **πΊοΈ Spatial Maps**: Interactive choropleth visualizations
### π Documentation & Tutorials
- **π Dataset Documentation**: Detailed variable descriptions
- **π» Code Examples**: Jupyter notebooks with analysis examples
- **π₯ Tutorial Videos**: Step-by-step analysis walkthroughs
- **π Analysis Templates**: Ready-to-use analysis scripts
### π Data Sources
- **NYC Open Data**: [https://opendata.cityofnewyork.us](https://opendata.cityofnewyork.us)
- **NYPD Complaint Data**: Updated daily with citywide crime reports
- **NYC 311**: Real-time citizen service requests
- **Department of Buildings**: Construction and permit data
### π€ Author & Contact
- **Author**: Ali Denewade
- **π ORCID**: [0009-0007-0069-4646](https://orcid.org/my-orcid?orcid=0009-0007-0069-4646)
- **π GitHub**: [alidenewade](https://github.com/alidenewade)
- **πΌ LinkedIn**: [alidenewade](https://www.linkedin.com/in/alidenewade/)
---
## π Start Exploring Today!
**Ready to dive into NYC's urban data?** π
This dataset opens up endless possibilities for understanding urban dynamics, predicting trends, and informing policy decisions. Whether you're building ML models, conducting academic research, or exploring data science applications, you'll find rich insights waiting to be discovered.
**π₯ [Download the Dataset](https://huggingface.co/datasets/alidenewade/nyc-urban-analytics)**
*Made with β€οΈ for the urban analytics and data science community*
---
*β If this dataset helps your research or projects, please consider citing it and sharing your findings with the community!* |