Uber Trip Visualization Dashboard

Hongri Jia
Passion for Data Science
4 min readApr 15, 2018

Tableau is a data visualization application to produce highly interactive, beautiful graphs, dashboards, and reports with any kind of structured data. In this blog, I will use a well-known data set about the Uber trips in New York City to make several dashboards and conduct some analysis on them.

Data Preprocessing

The raw data set contains four csv files with the monthly Uber trips records from April 2014 to July April and one Excel file with the weather information during these four month.

The first step is to import the data in these local files into MySQL database. One thing to be careful about here is the format of datetime data. Sometimes the data is not in the standard format such as “yyyy-mm-dd”. In this situation, you can load the data as “varchar” data type first, then use “str_to_date” to convert it into the standard format.

After loading the data files, I combine the Uber trips record data for four month into one table with “Union All” command. Then, the tables with weather data and Uber trip data should be joined together for the analysis. Generally, this step is done in MySQL, but this time I will use Tableau to work on this.

Data Visualization and Analysis

Initially, I have to connect Tableau with the MySQL database with the proper user name and port number set in MySQL previously. Then, you can drag the tables you want to use in the blank area and choose the join method you prefer. (See the following screenshot.) Tableau will join the tables on the common column automatically.

After obtaining the final data for analysis, I make a trip distribution map first. I want to know about how the Uber trips will distribute on workdays and weekends. According to the map, I find that there are much less Uber trips in districts surrounding Manhattan like Brooklyn and Queens on workdays than on weekends. This means that a large part of people in these areas working in the Manhattan and only on weekends they will stay at the areas they live and call Uber for going out. You can click the link below the picture to check the final outcome.

Click here to see the interactive plot

Then I make the plot to show the weekday trip number trend in different month and compare with the various weather conditions. It is obvious that the most two important factors affecting the trips number are the precipitation and the highest wind speed.

Click here to see the interactive plot

I also analyze the hourly trip number changing trend. Based on the upper plot in the following figure, you can see there are two peaks occurs on workdays which stand for the morning and afternoon rush hour due to the commuting. On weekends, people usually won’t go out in the morning but will have some fun in the afternoon or the evening, which cause the only peak of Uber trip.

Click here to see the interactive plot

The lower part is to compare the trip number for the given hour in different weekdays. In the figure, you can see at 12:00 am, there are much more trips at weekend than on workdays. This situation happens because people always have parties or other events at weekend night and go home very late.

All the other visualization I produce is published on the Tableau Public. If you are interested in it, you can click the following link:

--

--