Llamadas al número 311 en la ciudad de Boston.
Consulte este vínculo para obtener más información sobre BOS:311.
Volumen y retención
Este conjunto de datos se almacena en formato Parquet. Se actualiza a diario y contiene unas 100 000 filas (10 MB) en total desde 2019.
Este conjunto de datos contiene registros históricos acumulados desde 2011 hasta la actualidad. Puede usar la configuración de parámetros de nuestro SDK para recuperar los datos de un intervalo de tiempo específico.
Ubicación de almacenamiento
Este conjunto de datos se almacena en la región Este de EE. UU. de Azure. Se recomienda asignar recursos de proceso de la misma región por afinidad.
Información adicional
Este conjunto de datos se alimenta con los datos de la administración pública de la ciudad de Boston. Encontrará información más detallada aquí. Consulte Open Data Commons Public Domain Dedication and License (ODC PDDL) para obtener la licencia de uso de este conjunto de datos.
Notificaciones
MICROSOFT PROPORCIONA AZURE OPEN DATASETS “TAL CUAL”. MICROSOFT NO OFRECE NINGUNA GARANTÍA, EXPRESA O IMPLÍCITA, NI CONDICIÓN CON RESPECTO AL USO QUE USTED HAGA DE LOS CONJUNTOS DE DATOS. EN LA MEDIDA EN LA QUE LO PERMITA SU LEGISLACIÓN LOCAL, MICROSOFT DECLINA TODA RESPONSABILIDAD POR POSIBLES DAÑOS O PÉRDIDAS, INCLUIDOS LOS DAÑOS DIRECTOS, CONSECUENCIALES, ESPECIALES, INDIRECTOS, INCIDENTALES O PUNITIVOS, QUE RESULTEN DE SU USO DE LOS CONJUNTOS DE DATOS.
Este conjunto de datos se proporciona bajo los términos originales con los que Microsoft recibió los datos de origen. El conjunto de datos puede incluir datos procedentes de 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 | 311_All | 2/13/2021 11:55:07 PM | Code Enforcement | Unshoveled Sidewalk | Open | 50 East St Dorchester MA 02122 | 42.3073 | -71.0609 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 11:53:19 PM | Enforcement & Abandoned Vehicles | Parking Enforcement | Open | 148-150 Meridian St East Boston MA 02128 | 42.374 | -71.0393 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 11:50:52 PM | Graffiti | Graffiti Removal | Open | 50 Union St Boston MA 02108 | 42.3609 | -71.0571 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 11:48:21 PM | Highway Maintenance | Empty Litter Basket | Closed | INTERSECTION of E Stoughton St & Albany St Roxbury MA | 42.3594 | -71.0587 | City Worker App | |
Safety | 311_All | 2/13/2021 11:31:59 PM | Graffiti | Graffiti Removal | Open | INTERSECTION of Mechanic St & Hanover St Boston MA | 42.3594 | -71.0587 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 11:27:37 PM | Highway Maintenance | PWD Graffiti | Open | INTERSECTION of Claremont Park & Claremont St Roxbury MA | 42.3594 | -71.0587 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 11:16:00 PM | Signs & Signals | Traffic Signal Inspection | Open | INTERSECTION of Truman Pkwy & Fairmount Ave Hyde Park MA | 42.3594 | -71.0587 | Constituent Call | |
Safety | 311_All | 2/13/2021 10:58:19 PM | Enforcement & Abandoned Vehicles | Parking Enforcement | Open | 204-206 Marion St East Boston MA 02128 | 42.3754 | -71.0345 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 10:34:16 PM | Highway Maintenance | PWD Graffiti | Open | INTERSECTION of Claremont Park & Claremont St Roxbury MA | 42.3594 | -71.0587 | Citizens Connect App | |
Safety | 311_All | 2/13/2021 10:32:00 PM | Enforcement & Abandoned Vehicles | Parking Enforcement | Open | 1 Nassau St Boston MA 02111 | 42.3486 | -71.0629 | Constituent Call |
Name | Data type | Unique | Values (sample) | Description |
---|---|---|---|---|
address | string | 142,008 | \" \" 1 City Hall Plz Boston MA 02108 |
Ubicación. |
category | string | 54 | Street Cleaning Sanitation |
Motivo de la solicitud de servicio. |
dataSubtype | string | 1 | 311_All | “311_All” |
dataType | string | 1 | Safety | “Safety” |
dateTime | timestamp | 1,719,808 | 2015-07-23 10:51:00 2015-07-23 10:47:00 |
Fecha y hora de apertura de la solicitud de servicio. |
latitude | double | 1,622 | 42.3594 42.3603 |
Este es el valor de la latitud. Las líneas de la latitud son paralelas al ecuador. |
longitude | double | 1,806 | -71.0587 -71.0583 |
Este es el valor de la longitud. Las líneas de la longitud son perpendiculares a las líneas de la latitud y todas pasan por los dos polos. |
source | string | 7 | Constituent Call Citizens Connect App |
Fuente original del caso. |
status | string | 2 | Closed Open |
Estado del caso. |
subcategory | string | 208 | Parking Enforcement Requests for Street Cleaning |
Tipo de solicitud de servicio. |
Azure Notebooks
# This is a package in preview.
from azureml.opendatasets import BostonSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = BostonSafety(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=Boston"
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 BostonSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = BostonSafety(start_date=start_date, end_date=end_date)
safety = safety.to_spark_dataframe()
display(safety)
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Boston"
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
from azureml.opendatasets import BostonSafety
from datetime import datetime
from dateutil import parser
end_date = parser.parse('2016-01-01')
start_date = parser.parse('2015-05-01')
safety = BostonSafety(start_date=start_date, end_date=end_date)
safety = safety.to_spark_dataframe()
display(safety)
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "citydatacontainer"
blob_relative_path = "Safety/Release/city=Boston"
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.