Navigation überspringen

Seattle Safety Data

Seattle 911 Fire Dispatch E911 SFD Mobile Public Safety

911-Einsätze des Seattle Fire Department.

Volume und Aufbewahrung

Dieses Dataset wird im Parquet-Format gespeichert. Es wird täglich aktualisiert und enthält ab 2019 insgesamt etwa 800.000 Zeilen (20MB).

Dieses Dataset enthält historische Datensätze, die von 2010 bis heute gesammelt wurden. Verwenden Sie Parametereinstellungen im SDK, um Daten innerhalb eines bestimmten Zeitbereichs abzurufen.

Speicherort

Dieses Dataset wird in der Azure-Region „USA, Osten“ gespeichert. Aus Gründen der Affinität wird die Zuweisung von Computeressourcen in der Region „USA, Osten“ empfohlen.

Weitere Informationen

Dieses Dataset wurde von der Stadtverwaltung von Seattle bezogen. Einen Link zur Quelle finden Sie hier. Die Nutzungsbedingungen für dieses Dataset finden Sie unter Lizenzierung und Namensnennung. Senden Sie eine E-Mail an , wenn Sie Fragen zur Datenquelle haben.

Benachrichtigungen

MICROSOFT STELLT DATASETS DER PLATTFORM AZURE OPEN DATASETS AUF EINER „AS IS“-BASIS (D. H. OHNE MÄNGELGEWÄHR) ZUR VERFÜGUNG. MICROSOFT ÜBERNIMMT WEDER AUSDRÜCKLICH NOCH STILLSCHWEIGEND DIE GEWÄHRLEISTUNG FÜR IHRE NUTZUNG DER DATENSÄTZE UND SICHERT KEINERLEI GARANTIEN ODER BEDINGUNGEN ZU. SOWEIT NACH ÖRTLICH ANWENDBAREM RECHT ZULÄSSIG, LEHNT MICROSOFT JEGLICHE HAFTUNG FÜR SCHÄDEN ODER VERLUSTE AB. DIES SCHLIEßT DIREKTE, INDIREKTE, BESONDERE ODER ZUFÄLLIGE SCHÄDEN ODER VERLUSTE SOWIE FOLGE- UND STRAFSCHÄDEN UND DAMIT VERBUNDENE VERLUSTE EIN.

Für die Bereitstellung dieses Datasets gelten die ursprünglichen Nutzungsbedingungen, unter denen Microsoft die Quelldaten bezogen hat. Das Dataset kann Daten von Microsoft enthalten.

Access

Available inWhen 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 6/10/2021 9:39:00 AM Trans to AMR null null 223 Yesler Way 47.601718 -122.331581 null
Safety 911_Fire 6/10/2021 9:39:00 AM Trans to AMR null null 5564 16th Ave S 47.55297 -122.312303 null
Safety 911_Fire 6/10/2021 9:36:00 AM Trans to AMR null null 1700 Airport Way S 47.588225 -122.321391 null
Safety 911_Fire 6/10/2021 9:35:00 AM Auto Fire Alarm null null 1221 1st Ave 47.606268 -122.337677 null
Safety 911_Fire 6/10/2021 9:33:00 AM Aid Response null null 1700 E Madison St 47.61559 -122.310151 null
Safety 911_Fire 6/10/2021 9:31:00 AM Medic Response null null 10203 47th Ave Sw 47.511811 -122.392922 null
Safety 911_Fire 6/10/2021 9:30:00 AM Auto Fire Alarm null null 509 Rainier Ave S 47.598254 -122.313348 null
Safety 911_Fire 6/10/2021 9:30:00 AM Fire in Building null null 501 Rainier Ave S 47.598322 -122.3134 null
Safety 911_Fire 6/10/2021 9:29:00 AM Aid Response null null 8th Ave S / S King St 47.598348 -122.322448 null
Safety 911_Fire 6/10/2021 9:28:00 AM Auto Fire Alarm null null 3928 S Graham St 47.546018 -122.283106 null
Name Data type Unique Values (sample) Description
address string 198,066 517 3rd Av
318 2nd Av Et S

Ort des Vorfalls.

category string 232 Aid Response
Medic Response

Antworttyp.

dataSubtype string 1 911_Fire

„911_Fire“ (911, Feuer)

dataType string 1 Safety

„Safety“ (Sicherheit)

dateTime timestamp 1,537,741 2020-11-04 06:49:00
2019-07-04 18:26:00

Datum und Uhrzeit des Anrufs.

latitude double 94,461 47.602172
47.600194

Dies ist der Wert für den Breitengrad. Die Linien des Breitengrads sind parallel zum Äquator.

longitude double 79,571 -122.330863
-122.330541

Dies ist der Wert für den Längengrad. Die Linien der Längengrade verlaufen senkrecht zu den Linien der Breitengrade und durchlaufen beide Pole.

Select your preferred service:

Azure Notebooks

Azure Databricks

Azure Synapse

Azure Notebooks

Package: Language: Python Python
In [1]:
# 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()
ActivityStarted, to_pandas_dataframe ActivityStarted, to_pandas_dataframe_in_worker Looking for parquet files... Reading them into Pandas dataframe... Reading Safety/Release/city=Seattle/part-00119-tid-845600952581210110-a4f62588-4996-42d1-bc79-23a9b4635c63-446962.c000.snappy.parquet under container citydatacontainer Done. ActivityCompleted: Activity=to_pandas_dataframe_in_worker, HowEnded=Success, Duration=6116.21 [ms] ActivityCompleted: Activity=to_pandas_dataframe, HowEnded=Success, Duration=6117.7 [ms]
In [2]:
safety.info()
<class 'pandas.core.frame.DataFrame'> Int64Index: 68346 entries, 14 to 1382908 Data columns (total 11 columns): dataType 68346 non-null object dataSubtype 68346 non-null object dateTime 68346 non-null datetime64[ns] category 68346 non-null object subcategory 0 non-null object status 0 non-null object address 68345 non-null object latitude 68346 non-null float64 longitude 68346 non-null float64 source 0 non-null object extendedProperties 68346 non-null object dtypes: datetime64[ns](1), float64(2), object(8) memory usage: 6.3+ MB
In [1]:
# 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
In [2]:
# Azure storage access info
azure_storage_account_name = "azureopendatastorage"
azure_storage_sas_token = r""
container_name = "citydatacontainer"
folder_name = "Safety/Release/city=Seattle"
In [3]:
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)
In [4]:
# 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)
In [5]:
# you can add your filter at below
print('Loaded as a Pandas data frame: ')
df
In [6]:
 

Azure Databricks

Package: Language: Python Python
In [1]:
# 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()
ActivityStarted, to_spark_dataframe ActivityStarted, to_spark_dataframe_in_worker ActivityCompleted: Activity=to_spark_dataframe_in_worker, HowEnded=Success, Duration=2751.74 [ms] ActivityCompleted: Activity=to_spark_dataframe, HowEnded=Success, Duration=2753.86 [ms]
In [2]:
display(safety.limit(5))
dataTypedataSubtypedateTimecategorysubcategorystatusaddresslatitudelongitudesourceextendedProperties
Safety911_Fire2015-05-04T19:18:42.000+0000Medic Responsenullnull7101 38th Av S47.538872-122.284744nullincident_number:F150047883
Safety911_Fire2015-12-01T23:29:47.000+0000Aid Responsenullnull1011 S Weller St47.597509-122.319511nullincident_number:F150137603
Safety911_Fire2015-12-13T20:20:59.000+0000Aid Responsenullnull10049 College Way N47.701742-122.335029nullincident_number:F150142622
Safety911_Fire2015-11-23T00:19:21.000+0000Medic Responsenullnull9428 58th Av S47.518216-122.260497nullincident_number:F150134268
Safety911_Fire2015-05-19T16:25:55.000+0000Medic Responsenullnull10011 51st Av S47.510803-122.27006nullincident_number:F150054054
In [1]:
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Seattle"
blob_sas_token = r""
In [2]:
# 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)
In [3]:
# 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')
In [4]:
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))

Azure Synapse

Package: Language: Python Python SQL
In [21]:
# 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()
In [22]:
# Display top 5 rows
display(safety.limit(5))
Out[22]:
In [1]:
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Seattle"
blob_sas_token = r""
In [2]:
# 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)
In [3]:
# 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')
In [4]:
# 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.