Part II - Ford GoBike Trip Frequency and Duration¶

by Jose Murguia¶

Investigation Overview¶

In this study, I explored the factors that most effectively predict the duration and frequency of bike trips. The primary emphasis was on the time of day and the day of the week, along with the type of user specifically, whether the rider is a subscriber or a casual customer and the age of the user. Additionally, I examined the role of gender to determine its impact on the frequency and length of bike rides.

Dataset Overview¶

The Ford Go Bike dataset from 2019, after undergoing a cleaning process, includes 173,272 entries and 16 features: duration_sec, start_time, end_time, 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, member_birth_year, member_gender, bike_share_for_all_trip

The dataset comprises various data types, including datetimes, integers, floats, strings, and categorical variables. The user_type has two categories: "Subscriber" for members and "Customer" for casual users, while the gender category includes Female, Male, and Other. The bike_share_for_all_trip variable identifies participants in the Bike Share For All program. Additional features created from the data include age, start hour, day of the week, distance, and duration in minutes. Data cleaning involved removing null values, adjusting data types, and excluding outliers in the member_birth_year column.

Distribution of Trip Duration¶

This histogram illustrates the distribution of bike trip durations in minutes, with the majority of trips lasting between 5 and 15 minutes. The frequency peaks around 10 minutes and sharply declines for trips longer than 30 minutes, with very few trips exceeding 100 minutes. When displayed on a logarithmic scale, the distribution of these durations exhibits a normal pattern.

No description has been provided for this image

Bike Trip Frequency by Hour of the Day¶

The plot clearly shows that bike trips peak during commuting hours, specifically between 7 AM and 9 AM, as well as from 4 PM to 7 PM. Further analysis was conducted to determine whether this trend occurs primarily on weekdays.

No description has been provided for this image

Bike Trip Frequency by Day of the Week¶

This bar chart illustrates the frequency of bike rides by day of the week. The number of trips peaks on Thursday, followed closely by Tuesday, while Saturday and Sunday show the lowest number of rides. The data suggests higher bike usage during weekdays, with a noticeable drop on weekends.

No description has been provided for this image

Age Distribution of Cyclists¶

Both the histogram and viloin plot show a substantial number of cyclists fall within the age range of their late twenties to mid-thirties.

No description has been provided for this image
No description has been provided for this image

Bike Trip Frequency by Gender and User Type¶

We see males were more inclined to take bike trips, regardless of being subscribers or customers. Additionally, subscribers tended to take bike trips more frequently than customers.

No description has been provided for this image

Bike Trip Duration by Gender and User Type¶

The data indicates that females and others took longer bike trips than males, regardless of their subscription status. Interestingly, customers usually took longer trips than subscribers, who, on the other hand, engaged in more frequent, shorter rides.

No description has been provided for this image

Bike Trip Frequency by Day of the Week and Hour of Day¶

The heatmap below shows that the peak times for bike trips, specifically between 6 AM and 9 AM, as well as from 4 PM to 7 PM.

No description has been provided for this image

Bike Trip Duration by Day of the Week and Hour of Day¶

The heatmap below illustrates that, on average, the longest bike trips happen in the early morning hours during the weekdays, and that weekend trips tend to be longer than those on weekdays.

No description has been provided for this image