alidenewade commited on
Commit
cd217ee
Β·
verified Β·
1 Parent(s): eb6280e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +338 -3
README.md CHANGED
@@ -1,3 +1,338 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+ # πŸ™οΈ NYC Urban Indicators Dataset
5
+
6
+ [![GeoPandas](https://img.shields.io/badge/GeoPandas-Spatial%20Analysis-green)](https://geopandas.org)
7
+ [![Time Series](https://img.shields.io/badge/Time%20Series-Panel%20Data-blue)](https://pandas.pydata.org)
8
+ [![NYC Open Data](https://img.shields.io/badge/NYC-Open%20Data-orange)](https://opendata.cityofnewyork.us)
9
+ [![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
+ [![Hugging Face Datasets](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Datasets-blue)](https://huggingface.co/datasets/alidenewade/nyc-urban-analytics)
11
+
12
+ > **πŸ“Š [Download Dataset](https://huggingface.co/datasets/alidenewade/nyc-urban-analytics)** | **πŸ—ΊοΈ Geospatial Panel Data** | **πŸ“ˆ 7 Years of NYC Data** | **πŸ” Census Tract Level**
13
+
14
+ ## 🎯 A Geospatial Time-Series Panel for Census-Tract Level Analysis in New York City
15
+
16
+ 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.
17
+
18
+ ![Dataset Overview](https://via.placeholder.com/800x300/4A90E2/FFFFFF?text=NYC+Urban+Indicators+Dataset+%7C+2018-2024+%7C+Census+Tract+Level)
19
+
20
+ ## ✨ Dataset Highlights
21
+
22
+ | Feature | Description | Value |
23
+ |---------|-------------|-------|
24
+ | πŸ“… **Temporal Coverage** | January 2018 - December 2024 | 7+ years |
25
+ | πŸ—ΊοΈ **Spatial Resolution** | Census tract level (GEOID) | 2,168 tracts |
26
+ | πŸ“Š **Data Points** | Monthly observations per tract | 180,000+ records |
27
+ | πŸ”„ **Update Frequency** | Static historical dataset | Complete panel |
28
+ | πŸ“ˆ **Data Sources** | NYPD, NYC 311, DOB | Multi-agency |
29
+
30
+ ## πŸš€ Why This Dataset Matters
31
+
32
+ ### πŸŽ“ For Researchers & Academics
33
+ Created to facilitate the study of **urban dynamics** by providing a clean, merged, and canonicalized data source. Perfect for:
34
+ - **Spatial-temporal analysis** of urban patterns
35
+ - **Predictive modeling** of crime and service demands
36
+ - **Socioeconomic research** with neighborhood-level granularity
37
+ - **Policy impact assessment** through longitudinal analysis
38
+
39
+ ### πŸ“Š For Data Scientists & Analysts
40
+ 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:
41
+ - **Time-series forecasting** of urban indicators
42
+ - **Machine learning** tasks like crime prediction
43
+ - **Geospatial analysis** and mapping applications
44
+ - **Cross-sectional comparisons** across neighborhoods
45
+
46
+ ## πŸ“ Dataset Structure
47
+
48
+ ### Core Files
49
+
50
+ **πŸ“Š `nyc_cesium_features.parquet`** - Primary Panel Dataset
51
+ - **180,000+ observations** across 2,168 census tracts
52
+ - **84 monthly snapshots** from 2018-01 to 2024-12
53
+ - **Multi-dimensional indicators**: Crime, 311 requests, building permits
54
+ - **Optimized format**: Parquet for fast loading and analysis
55
+
56
+ **πŸ—ΊοΈ `nyc_tracts.parquet`** - Geospatial Reference File
57
+ - **Census tract geometries** in Well-Known Text (WKT) format
58
+ - **2,168 unique census tracts** covering all NYC boroughs
59
+ - **EPSG:4326 coordinate system** for global compatibility
60
+ - **Ready for mapping**: Compatible with GeoPandas and mapping libraries
61
+
62
+ ## πŸ“Š Data Schema & Variables
63
+
64
+ ### πŸ”‘ Primary Keys
65
+ - **`GEOID`**: 11-digit census tract identifier (e.g., "36061000100")
66
+ - **`month`**: Monthly timestamp (e.g., "2023-01")
67
+
68
+ ### 🚨 Crime Indicators (NYPD Data)
69
+ - **`crime_total`**: Total reported crimes per tract-month
70
+ - **`crime_felony`**: Felony-level crimes (most severe)
71
+ - **`crime_misd`**: Misdemeanor crimes (moderate severity)
72
+ - **`crime_viol`**: Violation-level crimes (least severe)
73
+
74
+ ### πŸ“ž Service Requests (NYC 311 Data)
75
+ - **`sr311_total`**: Total 311 service requests
76
+ - **Top 10 Complaint Types** with individual counts:
77
+ - `Noise - Residential`
78
+ - `Illegal Parking`
79
+ - `Street Light Condition`
80
+ - `Water System`
81
+ - `And 6 more frequent complaint categories...`
82
+
83
+ ### πŸ—οΈ Building Activity (DOB Data)
84
+ - **`dob_permits_total`**: Total Department of Buildings permits issued
85
+ - Includes construction, renovation, and building-related permits
86
+
87
+ ## πŸ› οΈ Data Sources & Methodology
88
+
89
+ ### πŸ“‹ Primary Data Sources
90
+ All data sourced from **NYC Open Data Portal** with proper attribution:
91
+
92
+ | Source | Agency | Data Type | Update Frequency |
93
+ |--------|---------|-----------|-----------------|
94
+ | **NYPD Complaint Data** | Police Department | Crime reports by severity | Daily |
95
+ | **311 Service Requests** | Multiple agencies | Citizen service requests | Real-time |
96
+ | **DOB Permit Issuances** | Buildings Department | Construction permits | Daily |
97
+
98
+ ### πŸ”„ Data Processing Pipeline
99
+ 1. **Data Extraction**: Automated downloads from NYC Open Data APIs
100
+ 2. **Temporal Aggregation**: Monthly summaries by census tract
101
+ 3. **Spatial Mapping**: Geocoding and tract assignment
102
+ 4. **Quality Assurance**: Missing value handling and outlier detection
103
+ 5. **Standardization**: Consistent naming and data types
104
+ 6. **Validation**: Cross-checking with official statistics
105
+
106
+ ## πŸ’» Quick Start Guide
107
+
108
+ ### Installation
109
+ ```bash
110
+ pip install datasets pandas geopandas shapely matplotlib
111
+ ```
112
+
113
+ ### Basic Usage
114
+ ```python
115
+ from datasets import load_dataset
116
+ import pandas as pd
117
+ import geopandas as gpd
118
+ from shapely import wkt
119
+
120
+ # Load the datasets from Hugging Face Hub
121
+ features_ds = load_dataset("alidenewade/nyc-urban-analytics",
122
+ split="train",
123
+ data_files="nyc_cesium_features.parquet")
124
+ tracts_ds = load_dataset("alidenewade/nyc-urban-analytics",
125
+ split="train",
126
+ data_files="nyc_tracts.parquet")
127
+
128
+ # Convert to pandas DataFrames
129
+ features_df = features_ds.to_pandas()
130
+ tracts_df = tracts_ds.to_pandas()
131
+
132
+ print(f"πŸ“Š Panel Data Shape: {features_df.shape}")
133
+ print(f"πŸ—ΊοΈ Geographic Data Shape: {tracts_df.shape}")
134
+ ```
135
+
136
+ ## πŸ—ΊοΈ Geospatial Analysis Example
137
+
138
+ ### Prepare Geographic Data
139
+ ```python
140
+ # Convert WKT strings to geometry objects
141
+ tracts_df['geometry'] = tracts_df['geometry'].apply(wkt.loads)
142
+
143
+ # Create GeoDataFrame
144
+ tracts_gdf = gpd.GeoDataFrame(tracts_df, geometry='geometry', crs="EPSG:4326")
145
+ ```
146
+
147
+ ### Crime Hotspot Analysis
148
+ ```python
149
+ # Aggregate crime data for 2023
150
+ features_df['month'] = pd.to_datetime(features_df['month'])
151
+ crime_2023 = features_df[features_df['month'].dt.year == 2023]
152
+ crime_by_tract = crime_2023.groupby('GEOID')['crime_total'].sum().reset_index()
153
+
154
+ # Merge with geographic data
155
+ crime_map = tracts_gdf.merge(crime_by_tract, on='GEOID', how='left').fillna(0)
156
+
157
+ # Create choropleth map
158
+ import matplotlib.pyplot as plt
159
+ fig, ax = plt.subplots(figsize=(15, 10))
160
+ crime_map.plot(column='crime_total',
161
+ cmap='viridis',
162
+ legend=True,
163
+ ax=ax)
164
+ ax.set_title('NYC Crime Density by Census Tract (2023)', fontsize=16)
165
+ plt.tight_layout()
166
+ plt.show()
167
+ ```
168
+
169
+ ## πŸ“ˆ Advanced Analysis Examples
170
+
171
+ ### Time Series Analysis
172
+ ```python
173
+ # Analyze crime trends for a specific tract
174
+ tract_id = "36061000100" # Example tract in Manhattan
175
+ tract_data = features_df[features_df['GEOID'] == tract_id].copy()
176
+ tract_data['month'] = pd.to_datetime(tract_data['month'])
177
+ tract_data = tract_data.sort_values('month')
178
+
179
+ # Plot time series
180
+ plt.figure(figsize=(12, 6))
181
+ plt.plot(tract_data['month'], tract_data['crime_total'], marker='o')
182
+ plt.title(f'Crime Trends - Census Tract {tract_id}')
183
+ plt.xlabel('Month')
184
+ plt.ylabel('Total Crimes')
185
+ plt.xticks(rotation=45)
186
+ plt.grid(True, alpha=0.3)
187
+ plt.tight_layout()
188
+ plt.show()
189
+ ```
190
+
191
+ ### Service Request Analysis
192
+ ```python
193
+ # Top 311 complaint types correlation with crime
194
+ correlation_data = features_df[['crime_total', 'sr311_total']].corr()
195
+ print("Crime vs 311 Requests Correlation:")
196
+ print(correlation_data)
197
+ ```
198
+
199
+ ## 🎯 Use Cases & Applications
200
+
201
+ ### πŸ›οΈ Urban Planning & Policy
202
+ - **Resource Allocation**: Identify high-need areas for police and city services
203
+ - **Infrastructure Planning**: Correlate building permits with service demands
204
+ - **Policy Evaluation**: Measure impact of interventions over time
205
+ - **Budget Optimization**: Data-driven allocation of municipal resources
206
+
207
+ ### πŸŽ“ Academic Research
208
+ - **Urban Sociology**: Study neighborhood dynamics and social patterns
209
+ - **Criminology**: Analyze crime patterns and environmental factors
210
+ - **Public Policy**: Evaluate effectiveness of urban interventions
211
+ - **Economics**: Research property values and neighborhood change
212
+
213
+ ### πŸ€– Machine Learning & Data Science
214
+ - **Predictive Modeling**: Forecast crime rates and service demands
215
+ - **Anomaly Detection**: Identify unusual patterns in urban data
216
+ - **Clustering Analysis**: Discover neighborhood typologies
217
+ - **Feature Engineering**: Create spatial-temporal variables
218
+
219
+ ### πŸ“Š Business Intelligence
220
+ - **Risk Assessment**: Location-based risk modeling for insurance/real estate
221
+ - **Market Analysis**: Understand neighborhood characteristics for business decisions
222
+ - **Service Planning**: Optimize delivery routes and service coverage
223
+ - **Investment Research**: Data-driven real estate and development insights
224
+
225
+ ## πŸ“‹ Data Quality & Limitations
226
+
227
+ ### βœ… Strengths
228
+ - **Comprehensive Coverage**: All NYC census tracts over 7 years
229
+ - **Multi-Source Integration**: Rich, multi-dimensional urban indicators
230
+ - **Temporal Consistency**: Standardized monthly aggregations
231
+ - **Spatial Precision**: Census tract level for detailed analysis
232
+ - **Clean Processing**: Automated QA/QC pipeline
233
+
234
+ ### ⚠️ Limitations & Considerations
235
+ - **Reporting Bias**: Crime data reflects reported incidents only
236
+ - **Temporal Lag**: Some data may have reporting delays
237
+ - **Spatial Accuracy**: Point-to-tract assignment may have edge cases
238
+ - **Missing Values**: Some tract-months may have zero observations
239
+ - **Seasonal Patterns**: Consider monthly variations in analysis
240
+
241
+ ## πŸ”§ Technical Specifications
242
+
243
+ ### File Formats & Sizes
244
+ - **Format**: Apache Parquet for optimal performance
245
+ - **Compression**: Snappy compression for fast I/O
246
+ - **Total Size**: ~50MB compressed
247
+ - **Memory Usage**: ~200MB when loaded in pandas
248
+
249
+ ### Performance Optimizations
250
+ - **Columnar Storage**: Efficient querying and filtering
251
+ - **Data Types**: Optimized integer and float precision
252
+ - **Indexing**: Pre-sorted by GEOID and month
253
+ - **Compatibility**: Works with pandas, polars, and dask
254
+
255
+ ## 🀝 Contributing & Feedback
256
+
257
+ We welcome contributions to improve this dataset! Here's how you can help:
258
+
259
+ ### πŸ“ Data Enhancement
260
+ - **Additional Variables**: Suggest new urban indicators to include
261
+ - **Quality Improvements**: Report data inconsistencies or errors
262
+ - **Methodology Feedback**: Propose better aggregation or processing methods
263
+ - **Documentation**: Improve variable descriptions and usage examples
264
+
265
+ ### πŸ”§ Technical Contributions
266
+ - **Analysis Examples**: Share interesting use cases and code
267
+ - **Visualization Tools**: Create plotting utilities and templates
268
+ - **Performance Optimizations**: Suggest faster loading/processing methods
269
+ - **Integration Guides**: Help with other platforms and tools
270
+
271
+ ## πŸ“– Citation & Attribution
272
+
273
+ If you use this dataset in your research, please consider citing it as:
274
+
275
+ ```bibtex
276
+ @misc{nyc_urban_analytics_2025,
277
+ author = {alidenewade},
278
+ title = {NYC Urban Indicators Dataset},
279
+ year = {2025},
280
+ publisher = {Hugging Face},
281
+ journal = {Hugging Face Hub},
282
+ howpublished = {\url{https://huggingface.co/datasets/alidenewade/nyc-urban-analytics}}
283
+ }
284
+ ```
285
+
286
+ ## πŸ“„ License
287
+
288
+ This dataset is licensed under the **MIT License**, allowing for both academic and commercial use with proper attribution.
289
+
290
+ ### License Summary
291
+ - βœ… **Commercial use** permitted
292
+ - βœ… **Modification and redistribution** allowed
293
+ - βœ… **Private use** permitted
294
+ - ❗ **No warranty** provided
295
+ - ❗ **Attribution** required
296
+
297
+ ## πŸ”— Related Resources
298
+
299
+ ### πŸ“Š Interactive Dashboard
300
+ Explore this data interactively with our **NYC Urban Analytics Dashboard**:
301
+ - **πŸš€ [Live Dashboard](https://huggingface.co/spaces/alidenewade/nyc-urban-analytics)**
302
+ - **πŸ€– ML Predictions**: Real-time crime risk classification
303
+ - **πŸ“ˆ Time Series**: SARIMAX forecasting capabilities
304
+ - **πŸ—ΊοΈ Spatial Maps**: Interactive choropleth visualizations
305
+
306
+ ### πŸ“š Documentation & Tutorials
307
+ - **πŸ“– Dataset Documentation**: Detailed variable descriptions
308
+ - **πŸ’» Code Examples**: Jupyter notebooks with analysis examples
309
+ - **πŸŽ₯ Tutorial Videos**: Step-by-step analysis walkthroughs
310
+ - **πŸ“Š Analysis Templates**: Ready-to-use analysis scripts
311
+
312
+ ### 🌐 Data Sources
313
+ - **NYC Open Data**: [https://opendata.cityofnewyork.us](https://opendata.cityofnewyork.us)
314
+ - **NYPD Complaint Data**: Updated daily with citywide crime reports
315
+ - **NYC 311**: Real-time citizen service requests
316
+ - **Department of Buildings**: Construction and permit data
317
+
318
+ ### πŸ‘€ Author & Contact
319
+ - **Author**: Ali Denewade
320
+ - **πŸŽ“ ORCID**: [0009-0007-0069-4646](https://orcid.org/my-orcid?orcid=0009-0007-0069-4646)
321
+ - **πŸ™ GitHub**: [alidenewade](https://github.com/alidenewade)
322
+ - **πŸ’Ό LinkedIn**: [alidenewade](https://www.linkedin.com/in/alidenewade/)
323
+
324
+ ---
325
+
326
+ ## πŸš€ Start Exploring Today!
327
+
328
+ **Ready to dive into NYC's urban data?** πŸ“Š
329
+
330
+ 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.
331
+
332
+ **πŸ“₯ [Download the Dataset](https://huggingface.co/datasets/alidenewade/nyc-urban-analytics)**
333
+
334
+ *Made with ❀️ for the urban analytics and data science community*
335
+
336
+ ---
337
+
338
+ *⭐ If this dataset helps your research or projects, please consider citing it and sharing your findings with the community!*