西雅图消防部门 911 调遣。
数量和保留期
此数据集以 Parquet 格式存储。 它每天更新一次,截至 2019 年总共包含约 80 万行 (20 MB)。
此数据集包含从 2010 年至今累积的历史记录。 可使用我们的 SDK 中的参数设置来提取特定时间范围内的数据。
存储位置
此数据集存储在美国东部 Azure 区域。 建议将计算资源分配到美国东部地区,以实现相关性。
其他信息
此数据集来自西雅图市政府。 有关源链接,请参阅此处。 有关此数据集的使用条款,请查看许可与署名。 如果对数据源有任何疑问,请发送电子邮件至 open.data@seattle.gov。
通知
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 | latitude | longitude | source | extendedProperties |
---|---|---|---|---|---|---|---|---|---|---|
Safety | 911_Fire | 1/14/2021 7:30:00 AM | 4RED - 2 + 1 + 1 | null | null | 3230 Sw Avalon Way | 47.564435 | -122.372755 | null | |
Safety | 911_Fire | 1/14/2021 7:03:00 AM | Aid Response | null | null | 1411 Boylston Av | 47.613098 | -122.323436 | null | |
Safety | 911_Fire | 1/14/2021 7:01:00 AM | Medic Response | null | null | Boren Ave N / Republican St | 47.623199 | -122.335838 | null | |
Safety | 911_Fire | 1/14/2021 6:59:00 AM | Aid Response | null | null | 1441 N Northlake Way | 47.647811 | -122.340658 | null | |
Safety | 911_Fire | 1/14/2021 6:48:00 AM | Aid Response | null | null | 805 4th Av N | 47.626322 | -122.348863 | null | |
Safety | 911_Fire | 1/14/2021 6:48:00 AM | Aid Response | null | null | 3720 Montlake Blvd Ne | 47.649404 | -122.304574 | null | |
Safety | 911_Fire | 1/14/2021 6:29:00 AM | Auto Fire Alarm | null | null | 1816 Bellevue Av | 47.617855 | -122.326761 | null | |
Safety | 911_Fire | 1/14/2021 6:16:00 AM | Aid Response | null | null | 4410 Meridian Ave N | 47.660396 | -122.333741 | null | |
Safety | 911_Fire | 1/14/2021 6:10:00 AM | Trans to AMR | null | null | 747 N 135th St | 47.726803 | -122.347793 | null | |
Safety | 911_Fire | 1/14/2021 5:56:00 AM | Fire in Building | null | null | 6823 Aurora Ave N | 47.679483 | -122.345426 | null |
Name | Data type | Unique | Values (sample) | Description |
---|---|---|---|---|
address | string | 191,447 | 517 3rd Av 318 2nd Av Et S |
事件位置。 |
category | string | 232 | Aid Response Medic Response |
响应类型。 |
dataSubtype | string | 1 | 911_Fire | “911_Fire” |
dataType | string | 1 | Safety | “Safety” |
dateTime | timestamp | 1,508,279 | 2020-11-04 06:49:00 2020-05-21 00:35:00 |
呼叫的日期和时间。 |
latitude | double | 93,730 | 47.602172 47.600194 |
这是纬度值。 纬线平行于赤道。 |
longitude | double | 79,096 | -122.330863 -122.330541 |
这是经度值。 经度线垂直于纬度线,并且都穿过两个极点。 |
Azure Notebooks
# This is a package in preview.
from azureml.opendatasets import SeattleSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = SeattleSafety(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=Seattle"
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 SeattleSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = SeattleSafety(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=Seattle"
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 SeattleSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = SeattleSafety(start_date=start_date, end_date=end_date)
safety = safety.to_spark_dataframe()
# Display top 5 rows
display(safety.limit(5))
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Seattle"
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'))
SELECT TOP 100 * FROM OPENROWSET( BULK 'https://azureopendatastorage.blob.core.windows.net/citydatacontainer/Safety/Release/city=Seattle/*.parquet', FORMAT = 'parquet' ) AS [r];

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.