Skip to content
Bikeshare Insights: Summer in the Windy City
Bikeshare Insights: Summer in the Windy City
This dataset contains information on Divvy Bikes, a bikeshare program that provides residents and visitors of Chicago with a convenient way to explore the city.
The workspace is set up with one CSV file containing bikeshare activities at the peak of the summer-July 2023. Columns include ride ID, bike type, start and end times, station names and IDs, location coordinates, and member type. Feel free to make this workspace yours by adding and removing cells, or editing any of the existing cells.
You can query the pre-loaded CSV files using SQL directly. Here’s a sample query:
- Show Dataset
# Read Data
import pandas as pd
divvy_jan2023 = pd.read_parquet("202307-divvy-tripdata.parquet")
divvy_jan2023
divvy_jan2023.to_csv('out.csv', index=False)
Display the number of times each bike type is used.
- Group by rideable_type and count ride_id, visualize results in bar chart
# Save to short name df
df = divvy_jan2023[["ride_id", "rideable_type"]]
df
# Group, sort and visualize the number of times each bike type is used.
df2 = df.groupby("rideable_type").agg({"ride_id": "count"}).rename(columns={"ride_id": "ride_count"})
df2 = df2.sort_values(by ="ride_count", ascending=False)
df2
Compare bike usage by member type to see if it affects bike choice.
- Group by rideable_type and member_casual, count ride_id, visualize results in grouped bar chart
# save dataframe in a new one for a second question
df1 = divvy_jan2023[["ride_id", "rideable_type", "member_casual"]]
df1
# Group, sort and visualize bike usage by member type
df_second = df1.groupby(['rideable_type', 'member_casual']).agg({"ride_id": "count"}).rename(columns={"ride_id": "ride_count"})
df_second = df_second.sort_values(by ="ride_count", ascending=False)
df_second
Illustrate the popularity of bikes at different times during the day and week
- Check data types, perform required convertions