Home » Uncategorized

Taming 1.5 Billion Rows of "Big Apple” Data

Diving into the many underlying trends throughout the entire 1.5 Billion rows of NYC Taxi data with Pivot Billion


laFEz8MqGF53unErDRZsHkSQbx-qO8_ptT3-3TpnUGrzVMiBc-dm7Zo52q2tzLuxbnqOBtas_tvu94aKY7binc__0KnzSPyPVt-l1uwC70qRQbuKjGcNtr_6__FWGuXFesQttYQFX2Vsv3RRRDw0Og99pD5OEuChvzvSTWLKJz37_gkIeLVgDtDVgrEvv042IdSxbGBSEH5HeStGOOQCRew5BiObKAhXKGxjKUrZgtMZM8W1ww6c3x9jDnTXR9LbByWByyqz0h4oEU2z

The age of data has arrived. With it, more and more datasets are created and they just keep getting bigger. Whether dealing with private or open data, individuals and organizations across the world are realizing that there are enormous amounts of information and insights to be gained from massive data. I wanted to dive into one of these accumulated datasets, the public NYC Taxi and Limousine Commission Trip Record Data, to explore passenger and taxi trends over the years. I decided to use Pivot Billions to analyze the data due to its scalability to handle massive datasets.

Using Pivot Billions, I took the over 208 compressed csv files to load 1.5 Billion rows of data into 170 Amazon c4.large instances in 3 minutes. Now that the data was loaded, I explored the data using Pivot Billions’ reorganization and transformation features. One thing I noticed right away is the data had tip and total taxi cost as separate columns. It’s more useful to compare percentages so I created a new tip percent metric from those columns using Pivot Billions’ f(x) function (took about 4 seconds). Another messy data property I noticed was overlapping payment type codes. As seen in the following column distribution, the codes were modified over the years and came in both cases as well as abbreviated and even numeric.

OaVHRZb0GsErumefZP2ebb3C1VwMUmqqr1blRMaJHAq7Ue4z-8uEmv4TVSM8EhQq1Xi3nfKmAuwjphbE05Imge2XM7ZjoaTfy6TqNZFmrZi3iPPKAXFgTc1evtR5VvZfliqEwVcF

I quickly applied a lookup table in Pivot Billions to create a new, cleaner transformed column called PayType. Now that my data was clean and enhanced enough to draw some meaningful insights, I simply pivoted my data to get the number of taxi trips and taxi payment statistics by PayType, year, and tip_percent.

915940943

By entering Pivot Billions’ PivotView, I visualized the data using a heatmap to compare the distribution of tips for cash and credit card passengers.

aaW5L0nTm5mJ9MFFUBxPgwwUpTPeesvvGtdiXLhgC4pi_j2C-WsUYOpTBMNDQ1RtafXRDnRILY9lh3tTzAY7-fYcKysjCQC4_9yzojHCs-cr5D2oGuQTZU7MVMcL3T_u0es59U8v

It was immediately clear that people paying in cash generally did not pay a tip or, more likely, the driver did not report a tip. However, credit card users typically paid ~16% tip, possibly due to the ease of the taxis’ touch panel payment system for credit card users.

Now that I understood a bit more about passenger and taxi tip behavior I wanted to see if I could find any other trends underlying the data. Quickly pivoting the data again to view the number of trips and trip distance statistics by year and month, I started to draw some new insights. By visualizing the data as a LineChart in PivotView and comparing the total trip distances by year to the average trip distances by year, I noticed an interesting discrepancy.

laFEz8MqGF53unErDRZsHkSQbx-qO8_ptT3-3TpnUGrzVMiBc-dm7Zo52q2tzLuxbnqOBtas_tvu94aKY7binc__0KnzSPyPVt-l1uwC70qRQbuKjGcNtr_6__FWGuXFesQttYQFX2Vsv3RRRDw0Og99pD5OEuChvzvSTWLKJz37_gkIeLVgDtDVgrEvv042IdSxbGBSEH5HeStGOOQCRew5BiObKAhXKGxjKUrZgtMZM8W1ww6c3x9jDnTXR9LbByWByyqz0h4oEU2z

Though the total trip distances were decreasing year over year, the average distances were rising slightly. The growing popularity of ridesharing in recent years is likely responsible for this trend, a nearly 40% reduction in total trip distances logged from 2009 to 2017.

By incorporating the rideshare data from the NYC Taxi and Limousine Commission Trip Record Data , and doing a quick comparison of total 2015 -2018 trips in the months of January, it shows a pretty remarkable shift in the riding habits in NYC.

V51w0DQ2T9tFPQf9VJdv_gHqlmY4XmXGgiA1E43fbVIHs78xB6AhuBSV2OA7fTWicv2rcKozElxXvKV4JH_jiIdB1xUY-z_6syAVDKklsgAIW0kgVz82318N3n1vWbvxYB2d8wvw

This chart seems to validate the underlying trend surmised in the prior analysis, that rideshare growth has eroded yellow taxi ridership by nearly 40%.

evvQuk_1Eh7NqjD0CfJDpbjiZIl0DT8kC5-MRpvLW6zhXi60zRuh5_K1gB_L4XszQ0_k21gG_Btxi-EbMLcuk088ChYYHFH–wBqplICL0SA3gsp51HnaygbaBUlC4A9JjbMKv1t