Citibike - Challenge.


Question:


The recent Citi Bike data has garnered a lot of attention. Attached you will find a data set of Citibike riders. The challenge is threefold:

1. Calculate the average trip time.

2. Visualize the male - female and subscriber - tourist ridership of the citi bikes over the period of a month.

3. Visualize the citibike usage by gender for a month averaged over a period of 24 hours.

Note:


Header of CSV file:

  • Trip Duration (seconds)
  • Start Time and Date
  • Stop Time and Date
  • Start Station id
  • Start Station Name
  • Start Station Latitude
  • Start Station Longitude
  • End Station id
  • End Station Name
  • End Station Latitude
  • End Station Longitude
  • Bike ID
  • User Type (Customer = 24-hour pass or 7-day pass user; Subscriber = Annual Member)
  • Year of Birth
  • Gender (0=unknown; 1=male; 2=female)

You can use this cheat sheet as a reference guide to complete your python challenge. You are allowed to use google. Use comments to explain what your code is doing.

A screenshot with the output is attached for your reference.

Instructions:


  1. You can google.
  2. You are not allowed to use 3rd party API for plotting graphs like plotly. You are required to use Matplotlib.
  3. If you think any other type of plot will help better understand the data, feel free to implement them.
  4. All the plots are expected to be in the same panel so be wise about the axis ratio when plotting.

Packages that you might need.


1. Numpy

2. Pandas

3. Matplotlib

4. datetime

Some methods that you might need from these packages:


Numpy:

Pandas

String Methods

Datetime

Reference Output 1


Citibike Challenge Reference fig 1

Reference Output 2


Citibike Challenge Reference fig 2


In [ ]: