Spring over navigation

NYC Taxi & Limousine Commission - yellow taxi trip records

NYC TLC Taxi yellow

Poster over ture med de gule taxaer omfatter felter med dato/tidspunkt for afhentninger og afleveringer, placering for afhentninger og afleveringer, turdistancer, specificerede priser, taksttyper, betalingstyper og passagerantal rapporteret af chaufføren.

Mængde og opbevaring

Dette datasæt gemmes i Parquet-formatet. Der er ca. 1.500.000.000 rækker (50 GB) i alt fra og med 2018.

Dette datasæt indeholder historiske poster, der er akkumuleret fra 2009 til 2018. Du kan bruge parameterindstillingerne i vores SDK til at hente data inden for en bestemt tidsperiode.

Lagerplacering

Dette datasæt er gemt i Azure-området Det østlige USA. Tildeling af beregningsressourcer i det østlige USA anbefales af tilhørsmæssige årsager.

Yderligere oplysninger

NYC TLC (Taxi and Limousine Commission):

Dataene blev indsamlet og stillet til rådighed over for NYC TLC (Taxi and Limousine Commission) af teknologileverandører, der er godkendt under TPEP/LPEP-programmerne (Taxicab & Livery Passenger Enhancement Programs). Turdataene blev ikke oprettet af TLC, og TLC fremsætter ingen erklæringer for nøjagtigheden af disse data.

Du kan finde ekstra oplysninger om TLC-turpostdata her og her.

Meddelelser

MICROSOFT STILLER AZURE OPEN DATASETS TIL RÅDIGHED, SOM DE ER OG FOREFINDES. MICROSOFT FRASKRIVER SIG ETHVERT ANSVAR, UDTRYKKELIGT ELLER STILTIENDE, OG GARANTIER ELLER BETINGELSER MED HENSYN TIL BRUGEN AF DATASÆTTENE. I DET OMFANG DET ER TILLADT I HENHOLD TIL GÆLDENDE LOVGIVNING FRASKRIVER MICROSOFT SIG ETHVERT ANSVAR FOR SKADER ELLER TAB, INKLUSIVE DIREKTE, FØLGESKADER, SÆRLIGE SKADER, INDIREKTE SKADER, HÆNDELIGE SKADER ELLER PONALE SKADER, DER MÅTTE OPSTÅ I FORBINDELSE MED BRUG AF DATASÆTTENE.

Dette datasæt stilles til rådighed under de oprindelige vilkår, som Microsoft modtog kildedataene under. Datasættet kan indeholde data fra Microsoft.

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

vendorID tpepPickupDateTime tpepDropoffDateTime passengerCount tripDistance puLocationId doLocationId rateCodeId storeAndFwdFlag paymentType fareAmount extra mtaTax improvementSurcharge tipAmount tollsAmount totalAmount puYear puMonth
2 1/24/2088 12:25:39 AM 1/24/2088 7:28:25 AM 1 4.05 24 162 1 N 2 14.5 0 0.5 0.3 0 0 15.3 2088 1
2 1/24/2088 12:15:42 AM 1/24/2088 12:19:46 AM 1 0.63 41 166 1 N 2 4.5 0 0.5 0.3 0 0 5.3 2088 1
2 11/4/2084 12:32:24 PM 11/4/2084 12:47:41 PM 1 1.34 238 236 1 N 2 10 0 0.5 0.3 0 0 10.8 2084 11
2 11/4/2084 12:25:53 PM 11/4/2084 12:29:00 PM 1 0.32 238 238 1 N 2 4 0 0.5 0.3 0 0 4.8 2084 11
2 11/4/2084 12:08:33 PM 11/4/2084 12:22:24 PM 1 1.85 236 238 1 N 2 10 0 0.5 0.3 0 0 10.8 2084 11
2 11/4/2084 11:41:35 AM 11/4/2084 11:59:41 AM 1 1.65 68 237 1 N 2 12.5 0 0.5 0.3 0 0 13.3 2084 11
2 11/4/2084 11:27:28 AM 11/4/2084 11:39:52 AM 1 1.07 170 68 1 N 2 9 0 0.5 0.3 0 0 9.8 2084 11
2 11/4/2084 11:19:06 AM 11/4/2084 11:26:44 AM 1 1.3 107 170 1 N 2 7.5 0 0.5 0.3 0 0 8.3 2084 11
2 11/4/2084 11:02:59 AM 11/4/2084 11:15:51 AM 1 1.85 113 137 1 N 2 10 0 0.5 0.3 0 0 10.8 2084 11
2 11/4/2084 10:46:05 AM 11/4/2084 10:50:09 AM 1 0.62 231 231 1 N 2 4.5 0 0.5 0.3 0 0 5.3 2084 11
Name Data type Unique Values (sample) Description
doLocationId string 265 236
161

Den TLC-taxazone, hvor taxameteret blev slået fra.

endLat double 961,994 41.366138
40.75
endLon double 1,144,935 -73.137393
-73.9824
extra double 877 0.5
1.0

Forskellige tillæg. I øjeblikket omfatter det kun $0,50 og $1 i myldretiden og nattillæg.

fareAmount double 18,935 6.5
4.5

Den tids- og afstandsmæssige takst, der beregnes af taxameteret.

improvementSurcharge string 60 0.3
0

Forbedringstillæg på $0,30 takseret for ture ved flag drop-udstigning. Forbedringstillægget begyndte at blive opkrævet i 2015.

mtaTax double 360 0.5
-0.5

MTA-afgift på $0,50, der automatisk udløses på baggrund af den taxametertakst, der benyttes.

passengerCount int 64 1
2

Antallet af passagerer i køretøjet. Denne værdi indtastes af chaufføren.

paymentType string 6,282 CSH
CRD

En numerisk kode, der angiver, hvordan passageren betalte for turen.

1 = kreditkort

2 = kontant

3 = intet gebyr

4 = uenighed

5 = ukendt

6 = annulleret tur

puLocationId string 266 237
161

Den TLC-taxazone, hvor taxameteret blev slået til.

puMonth int 12 3
5
puYear int 29 2012
2011
rateCodeId int 56 1
2

Koden for den endelige takst ved afslutning af turen.

1 = Standardtakst

2 = JFK

3 = Newark

4 = Nassau eller Westchester

5 = Aftalt pris

6 = Gruppetur

startLat double 833,016 41.366138
40.7741
startLon double 957,428 -73.137393
-73.9824
storeAndFwdFlag string 8 N
0

Dette flag angiver, om turposten blev opbevaret i køretøjets hukommelse, før den blev sendt til forhandleren, dvs. “store and forward” (gem og videresend), fordi køretøjet ikke havde forbindelse til serveren.

Y = gem og videresend-tur

N = ikke en gem og videresend-tur

tipAmount double 12,121 1.0
2.0

Dette felt udfyldes automatisk for drikkepenge via kreditkort. Drikkepenge i kontanter er ikke inkluderet.

tollsAmount double 6,634 5.33
4.8

Den samlede mængde afgifter, der blev betalt under turen.

totalAmount double 39,707 7.0
7.8

Det samlede beløb, som er blevet opkrævet af passagerer. Inkluderer ikke drikkepenge.

tpepDropoffDateTime timestamp 290,185,010 2009-11-01 01:55:00
2010-04-09 21:08:00

Dato og tidspunkt for, hvornår taxameteret blev slået fra.

tpepPickupDateTime timestamp 289,948,585 2009-11-01 01:05:00
2011-11-06 01:05:00

Den dato og det klokkeslæt, hvor taxameteret blev aktiveret.

tripDistance double 14,003 1.0
0.9

Den forløbne turafstand i mil, som den fremgår af taxameteret.

vendorID string 7 VTS
CMT

En kode, der angiver den TPEP-udbyder, der stiller posten til rådighed.

1 = Creative Mobile Technologies, LLC

2 = VeriFone Inc.

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 NycTlcYellow

from datetime import datetime
from dateutil import parser


end_date = parser.parse('2018-06-06')
start_date = parser.parse('2018-05-01')
nyc_tlc = NycTlcYellow(start_date=start_date, end_date=end_date)
nyc_tlc_df = nyc_tlc.to_pandas_dataframe()
ActivityStarted, to_pandas_dataframe ActivityStarted, to_pandas_dataframe_in_worker Target paths: ['/puYear=2018/puMonth=5/', '/puYear=2018/puMonth=6/'] Looking for parquet files... Reading them into Pandas dataframe... Reading yellow/puYear=2018/puMonth=5/part-00087-tid-4962944523873006564-6d1b261c-5f96-4819-ba4d-a034cf2bc6ec-12005.c000.snappy.parquet under container nyctlc Reading yellow/puYear=2018/puMonth=6/part-00171-tid-4962944523873006564-6d1b261c-5f96-4819-ba4d-a034cf2bc6ec-12089.c000.snappy.parquet under container nyctlc Done. ActivityCompleted: Activity=to_pandas_dataframe_in_worker, HowEnded=Success, Duration=137433.5 [ms] ActivityCompleted: Activity=to_pandas_dataframe, HowEnded=Success, Duration=137510.05 [ms]
In [2]:
nyc_tlc_df.info()
<class 'pandas.core.frame.DataFrame'> Int64Index: 10695823 entries, 189 to 5673232 Data columns (total 21 columns): vendorID object tpepPickupDateTime datetime64[ns] tpepDropoffDateTime datetime64[ns] passengerCount int32 tripDistance float64 puLocationId object doLocationId object startLon float64 startLat float64 endLon float64 endLat float64 rateCodeId int32 storeAndFwdFlag object paymentType object fareAmount float64 extra float64 mtaTax float64 improvementSurcharge object tipAmount float64 tollsAmount float64 totalAmount float64 dtypes: datetime64[ns](2), float64(11), int32(2), object(6) memory usage: 1.7+ GB
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 = "nyctlc"
folder_name = "yellow"
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 NycTlcYellow

from datetime import datetime
from dateutil import parser


end_date = parser.parse('2018-06-06')
start_date = parser.parse('2018-05-01')
nyc_tlc = NycTlcYellow(start_date=start_date, end_date=end_date)
nyc_tlc_df = nyc_tlc.to_spark_dataframe()
ActivityStarted, to_spark_dataframe ActivityStarted, to_spark_dataframe_in_worker ActivityCompleted: Activity=to_spark_dataframe_in_worker, HowEnded=Success, Duration=91957.61 [ms] ActivityCompleted: Activity=to_spark_dataframe, HowEnded=Success, Duration=91961.14 [ms]
In [2]:
display(nyc_tlc_df.limit(5))
vendorIDtpepPickupDateTimetpepDropoffDateTimepassengerCounttripDistancepuLocationIddoLocationIdstartLonstartLatendLonendLatrateCodeIdstoreAndFwdFlagpaymentTypefareAmountextramtaTaximprovementSurchargetipAmounttollsAmounttotalAmountpuYearpuMonth
22018-06-05T23:37:15.000+00002018-06-06T00:15:57.000+0000121.65132142nullnullnullnull2N152.00.00.50.38.05.7666.5620186
22018-05-31T18:04:19.000+00002018-06-01T17:56:15.000+000019.95230138nullnullnullnull1N135.01.00.50.38.515.7651.0720186
22018-05-31T18:58:20.000+00002018-06-01T18:55:28.000+000021.9148239nullnullnullnull1N212.01.00.50.30.00.013.820186
22018-05-31T16:45:53.000+00002018-06-01T16:06:26.000+000062.79230125nullnullnullnull1N214.01.00.50.30.00.015.820186
22018-05-31T15:08:53.000+00002018-06-01T14:21:29.000+000011.723674nullnullnullnull1N110.01.00.50.32.360.014.1620186
In [1]:
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "nyctlc"
blob_relative_path = "yellow"
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
In [31]:
# This is a package in preview.
from azureml.opendatasets import NycTlcYellow

from datetime import datetime
from dateutil import parser


end_date = parser.parse('2018-06-06')
start_date = parser.parse('2018-05-01')
nyc_tlc = NycTlcYellow(start_date=start_date, end_date=end_date)
nyc_tlc_df = nyc_tlc.to_spark_dataframe()
In [32]:
# Display top 5 rows
display(nyc_tlc_df.limit(5))
Out[32]:
In [1]:
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "nyctlc"
blob_relative_path = "yellow"
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'))