Chicago Safety Data
芝加哥市的 311 服务请求,包括历史的卫生法规投诉、报告的坑洞和路灯问题
自 2011 年 1 月 1 日以来,所有向 311 提出的待解决的卫生法规投诉和所有已完成的请求。 芝加哥街道卫生局调查了报告的违反芝加哥卫生法规的行为,并采取了补救措施。 对于违规行为(例如垃圾箱溢出和小巷中的垃圾),居民可以提出服务请求。 311 有时会收到重复的卫生法规投诉。 被标记为重复项的请求与在先请求位于同一地理区域,并且大致在同一时间输入到 311 的客户服务请求 (CSR) 系统中。 重复投诉在状态字段中被标记为“待解决 - 重复”或“已完成 - 重复”。
芝加哥交通部 (CDOT) 监管芝加哥 4,000 多英里主干道和住宅街道上的坑洞修补。 CDOT 通过 311 呼叫中心接收坑洞报告,并使用计算机化的地图和跟踪系统来确定坑洞位置并高效调度工作人员。 一次 311 呼叫可能会导致多次坑洞修补。 工作人员到达并修补一个 311 坑洞时,会填满该街区中的所有其他坑洞。 坑洞修补通常在 311 第一次收到坑洞报告 7 天内完成。 天气状况(尤其是严寒和降雨)会影响修补时间,。 在天气情况良好且没有降雨的时候,工作人员可以修补数千个坑洞。 如果对于 4 个地址的缓冲范围,已提出一个在先请求,则系统将该请求的状态设为“重复(待解决)”。 例如,如果存在一个用于 6535 N Western 的 CSR,并且收到了针对 6531 N Western(位于原始 CSR 的 4 个地址之内)的新请求,则系统将新请求的状态设为“重复(待解决)”。 街道修补完成后,原始请求在 CSR 中的状态显示为“已完成”,任何重复请求的状态显示为“重复(已解决)”。 已检查报告的地址但未发现坑洞或坑洞已修补时,服务请求的状态也是“已完成”。 如果发现了街道的其他问题(例如“塌陷”或“公共设施断开失败”),则转而提交到相应的部门或承包商。
自 2011 年 1 月 1 日以来,所有向 311 提出的“路灯 - 全部故障”(3 盏或 3 盏以上的灯发生故障)的待解决报告以及所有已完成的请求。芝加哥交通局 (CDOT) 监管约 250,000 盏路灯,这些路灯覆盖芝加哥的主干道和住宅街道。 CDOT 根据居民对路灯故障的报告进行维修和灯泡更换。 每当 CDOT 收到“全部故障”的报告时,所指派的维修电工将查看该电路中的所有路灯(每个电路有 8 - 16 盏灯),确保均正常工作。 如果在原始请求的 4 个日历日内提出对同一电路中路灯故障的第二个请求,则最新请求自动设置为“重复(待解决)”状态。 由于 CDOT 的电工将查看电路中的所有灯,验证其是否均正常工作,因此将自动查看任何“重复(待解决)”地址并进行维修。 路灯维修完成后,原始请求在 CSR 中的状态显示为“已完成”,任何重复请求的状态显示为“重复(已解决)”。 发生以下情况之一时,服务请求也会设置为“已完成”状态:已检查报告的灯但发现维修情况良好且功能正常;服务请求针对于不存在的地址;灯由承包商维护。 数据每天更新。
数量和保留期
此数据集以 Parquet 格式存储。 每天更新,截至 2018 年总共包括约 1 百万行 (80 MB)。
此数据集包括从 2011 年到 2018 年累积的历史记录。 可使用我们的 SDK 中的参数设置来提取特定时间范围内的数据。
存储位置
此数据集存储在美国东部 Azure 区域。 建议将计算资源分配到美国东部地区,以实现相关性。
其他信息
此数据集源自芝加哥市政府。 可以通过以下链接找到更多详细信息:卫生、坑洞、路灯。
有关此数据集的使用条款,请参阅此处。 如果对数据源有任何疑问,请发送电子邮件至 dataportal@cityofchicago.org。
通知
Microsoft 以“原样”为基础提供 AZURE 开放数据集。 Microsoft 对数据集的使用不提供任何担保(明示或暗示)、保证或条件。 在当地法律允许的范围内,Microsoft 对使用数据集而导致的任何损害或损失不承担任何责任,包括直接、必然、特殊、间接、偶发或惩罚。
此数据集是根据 Microsoft 接收源数据的原始条款提供的。 数据集可能包含来自 Microsoft 的数据。
Access
Available in | When to use |
---|---|
Azure Notebooks | Quickly explore the dataset with Jupyter notebooks hosted on Azure or your local machine. |
Azure Databricks | Use this when you need the scale of an Azure managed Spark cluster to process the dataset. |
Azure Synapse | Use this when you need the scale of an Azure managed Spark cluster to process the dataset. |
Preview
dataType | dataSubtype | dateTime | category | subcategory | status | address | source | extendedProperties | latitude | longitude |
---|---|---|---|---|---|---|---|---|---|---|
Safety | 311_All | 1/20/2021 11:53:25 PM | 311 INFORMATION ONLY CALL | null | Completed | 2111 W Lexington ST | null | |||
Safety | 311_All | 1/20/2021 11:52:43 PM | 311 INFORMATION ONLY CALL | null | Completed | 2111 W Lexington ST | null | |||
Safety | 311_All | 1/20/2021 11:52:08 PM | 311 INFORMATION ONLY CALL | null | Completed | 2111 W Lexington ST | null | |||
Safety | 311_All | 1/20/2021 11:49:54 PM | Graffiti Removal Request | null | Open | 2256 S HAMLIN AVE | null | 41.849984966 | -87.720086041 | |
Safety | 311_All | 1/20/2021 11:48:25 PM | Sewer Cave-In Inspection Request | null | Open | 8351 S SOUTH CHICAGO AVE | null | 41.7430445 | -87.573821277 | |
Safety | 311_All | 1/20/2021 11:47:18 PM | 311 INFORMATION ONLY CALL | null | Completed | 2111 W Lexington ST | null | |||
Safety | 311_All | 1/20/2021 11:46:04 PM | Sewer Cave-In Inspection Request | null | Open | 8146 S SOUTH CHICAGO AVE | null | 41.746695051 | -87.578946832 | |
Safety | 311_All | 1/20/2021 11:44:58 PM | Aircraft Noise Complaint | null | Completed | 10510 W ZEMKE RD | null | |||
Safety | 311_All | 1/20/2021 11:43:31 PM | Alley Light Out Complaint | null | Open | 8600 S KINGSTON AVE | null | 41.738940473 | -87.562658564 | |
Safety | 311_All | 1/20/2021 11:41:31 PM | Sewer Cave-In Inspection Request | null | Open | 8346 S SOUTH CHICAGO AVE | null | 41.743444233 | -87.574429988 |
Name | Data type | Unique | Values (sample) | Description |
---|---|---|---|---|
address | string | 798,347 | 2111 W Lexington ST 10510 W ZEMKE RD |
街道地址。 |
category | string | 99 | 311 INFORMATION ONLY CALL Aircraft Noise Complaint |
服务请求类型。 |
dataSubtype | string | 1 | 311_All | “311_Sanitation”、“311_Potholes”或“311_Street_Lights”。 |
dataType | string | 1 | Safety | “安全性”。 |
dateTime | timestamp | 3,699,930 | 2014-01-13 00:00:00 2014-03-10 00:00:00 |
服务请求的创建日期。 |
latitude | double | 1,114,162 | 41.871831278 41.994896549 |
纬度。 |
longitude | double | 1,228,984 | -87.679846219 -87.887751654 |
经度。 |
status | string | 5 | Completed Completed - Dup |
服务请求的状态,指示请求是否完成。 |
Azure Notebooks
# This is a package in preview.
from azureml.opendatasets import ChicagoSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = ChicagoSafety(start_date=start_date, end_date=end_date)
safety = safety.to_pandas_dataframe()
safety.info()
# Pip install packages
import os, sys
!{sys.executable} -m pip install azure-storage-blob
!{sys.executable} -m pip install pyarrow
!{sys.executable} -m pip install pandas
# Azure storage access info
azure_storage_account_name = "azureopendatastorage"
azure_storage_sas_token = r""
container_name = "citydatacontainer"
folder_name = "Safety/Release/city=Chicago"
from azure.storage.blob import BlockBlobServicefrom azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
if azure_storage_account_name is None or azure_storage_sas_token is None:
raise Exception(
"Provide your specific name and key for your Azure Storage account--see the Prerequisites section earlier.")
print('Looking for the first parquet under the folder ' +
folder_name + ' in container "' + container_name + '"...')
container_url = f"https://{azure_storage_account_name}.blob.core.windows.net/"
blob_service_client = BlobServiceClient(
container_url, azure_storage_sas_token if azure_storage_sas_token else None)
container_client = blob_service_client.get_container_client(container_name)
blobs = container_client.list_blobs(folder_name)
sorted_blobs = sorted(list(blobs), key=lambda e: e.name, reverse=True)
targetBlobName = ''
for blob in sorted_blobs:
if blob.name.startswith(folder_name) and blob.name.endswith('.parquet'):
targetBlobName = blob.name
break
print('Target blob to download: ' + targetBlobName)
_, filename = os.path.split(targetBlobName)
blob_client = container_client.get_blob_client(targetBlobName)
with open(filename, 'wb') as local_file:
blob_client.download_blob().download_to_stream(local_file)
# Read the parquet file into Pandas data frame
import pandas as pd
print('Reading the parquet file into Pandas data frame')
df = pd.read_parquet(filename)
# you can add your filter at below
print('Loaded as a Pandas data frame: ')
df
Azure Databricks
# This is a package in preview.
# You need to pip install azureml-opendatasets in Databricks cluster. https://docs.microsoft.com/en-us/azure/data-explorer/connect-from-databricks#install-the-python-library-on-your-azure-databricks-cluster
from azureml.opendatasets import ChicagoSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = ChicagoSafety(start_date=start_date, end_date=end_date)
safety = safety.to_spark_dataframe()
display(safety.limit(5))
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Chicago"
blob_sas_token = r""
# Allow SPARK to read from Blob remotely
wasbs_path = 'wasbs://%s@%s.blob.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
spark.conf.set(
'fs.azure.sas.%s.%s.blob.core.windows.net' % (blob_container_name, blob_account_name),
blob_sas_token)
print('Remote blob path: ' + wasbs_path)
# SPARK read parquet, note that it won't load any data yet by now
df = spark.read.parquet(wasbs_path)
print('Register the DataFrame as a SQL temporary view: source')
df.createOrReplaceTempView('source')
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))
Azure Synapse
# This is a package in preview.
from azureml.opendatasets import ChicagoSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = ChicagoSafety(start_date=start_date, end_date=end_date)
safety = safety.to_spark_dataframe()
# Display top 5 rows
display(safety.limit(5))
# Display data statistic information
display(safety, summary = True)
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Chicago"
blob_sas_token = r""
# Allow SPARK to read from Blob remotely
wasbs_path = 'wasbs://%s@%s.blob.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
spark.conf.set(
'fs.azure.sas.%s.%s.blob.core.windows.net' % (blob_container_name, blob_account_name),
blob_sas_token)
print('Remote blob path: ' + wasbs_path)
# SPARK read parquet, note that it won't load any data yet by now
df = spark.read.parquet(wasbs_path)
print('Register the DataFrame as a SQL temporary view: source')
df.createOrReplaceTempView('source')
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))

City Safety
From the Urban Innovation Initiative at Microsoft Research, databricks notebook for analytics with safety data (311 and 911 call data) from major U.S. cities. Analyses show frequency distributions and geographic clustering of safety issues within cities.