Hopp over navigasjon

NYC Taxi & Limousine Commission - yellow taxi trip records

NYC TLC Taxi yellow

De gule taxireisepostene inkluderer felt som fanger opp datoer/klokkeslett for henting og avlevering, steder for henting og avlevering, reiseavstander, spesifiserte priser, pristyper, betalingstyper og førerrapporterte passasjertall.

Volum og dataoppbevaring

Dette datasettet er lagret i Parquet-format. Det er ca. 1,5B rader (50 GB) totalt fra og med 2018.

Dette datasettet inneholder historiske poster akkumulert fra 2009 til 2018. Du kan bruke parameterinnstillinger i vårt SDK til å hente data innenfor et spesifikt tidsintervall.

Lagerplassering

Dette datasettet er lagret i Azure-området i øst-USA. Tildeling av databehandlingsressurser i øst-USA er anbefalt for affinitet.

Mer informasjon

NYC Taxi and Limousine Commission (TLC):

Dataene ble samlet inn og levert til NYC Taxi and Limousine Commission (TLC) av teknologileverandører autorisert under programmene Taxicab & Livery Passenger Enhancement (TPEP/LPEP). Reisedataene ble ikke opprettet av TLC, og TLC gir ingen framstilling hva gjelder nøyaktigheten av disse dataene.

Du finner ytterligere informasjon om TLC-reisepostdata her og her.

Merknader

MICROSOFT LEVERER AZURE OPEN DATASETS PÅ EN “SOM DE ER”-BASIS. MICROSOFT GIR INGEN GARANTIER, UTTRYKTE ELLER IMPLISERTE, ELLER BETINGELSER MED HENSYN TIL DIN BRUK AV DATASETTENE. I DEN GRAD LOKAL LOV TILLATER DET, FRASKRIVER MICROSOFT SEG ALT ANSVAR FOR EVENTUELLE SKADER ELLER TAP, INKLUDERT DIREKTE SKADE, FØLGESKADE, DOKUMENTERT ERSTATNINGSKRAV, INDIREKTE SKADE ELLER ERSTATNING UTOVER DET SOM VILLE VÆRE NORMALT, SOM FØLGE AV DIN BRUK AV DATASETTENE.

Dette datasettet leveres i henhold til de originale vilkårene Microsoft mottok kildedata. Datasettet kan inkludere data hentet 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 161
236

TLC-taxisonen taksameteret ble koblet 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

Diverse ekstrautgifter og tillegg. For øyeblikket inkluderer dette kun rushtidsavgift og overnattingsgebyr på $0,50 og $1.

fareAmount double 18,935 6.5
4.5

Tid og avstand beregnet av måleren.

improvementSurcharge string 60 0.3
0

$0,30 forbedringsgebyr vurderte reise ved flaggdropp. Forbedringsgebyret ble pålagt fra og med 2015.

mtaTax double 360 0.5
-0.5

$0,50 MTA-skatt som automatisk utløses basert på målt pris i bruk.

passengerCount int 64 1
2

Antall passasjerer i kjøretøyet. Dette er en førerangitt verdi.

paymentType string 6,282 CSH
CRD

En numerisk kode som forteller hvordan passasjeren betalte for reisen.

1=Kredittkort;

2=Kontant;

3=Ingen kostnad;

4=Tvist;

5=Ukjent;

6=Ugyldig reise.

puLocationId string 266 237
161

TLC-taxisonen taksameteret ble satt på.

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

Den endelige priskoden i kraft på slutten av reisen.

1= Standardpris;

2= JFK;

3= Newark;

4= Nassau eller Westchester;

5= Forhandlet pris;

6= Gruppereise.

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

Dette flagget indikerer om reiseposten var i kjøretøyminne før sending til leverandøren, aka “mellomreise,” fordi kjøretøyet ikke hadde en tilkobling til serveren.

Y= mellomreise;

N=ikke en mellomreise.

tipAmount double 12,121 1.0
2.0

Dette feltet fylles automatisk inn for kredittkorttips. Kontanttips er ikke inkludert.

tollsAmount double 6,634 5.33
4.8

Totalbeløp for alle avgifter betalt på en reise.

totalAmount double 39,707 7.0
7.8

Totalbeløpet belastet passasjerer. Inkluderer ikke kontanttips.

tpepDropoffDateTime timestamp 290,185,010 2009-11-01 01:25:00
2013-11-03 01:50:00

Datoen og klokkeslettet måleren var koblet fra.

tpepPickupDateTime timestamp 289,948,585 2010-11-07 01:30:00
2013-11-03 01:35:00

Datoen og klokkeslettet måleren var koblet til.

tripDistance double 14,003 1.0
0.9

Den forløpte reiseavstanden i miles rapportert av taksameter.

vendorID string 7 VTS
CMT

En kode som indikerer TPEP-leverandøren som oppga posten.

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'))