Homework 3 — Blue Bikes: Tables
Skills: 1, 2, 12
Due
Thursday, September 25, 2025 at 6PM (Oakland) or 9PM (Boston)
Introduction
Bluebikes is a public bike share system in the Boston metropolitan area. Similar bike sharing systems exist in many cities, like Bay Wheels in Oakland, Citi Bike in New York City, and Santander Cycles in London.
In this assignment, you'll analyze trip data from the Bluebikes system to practice working with tables, filtering data, creating visualizations, and transforming columns.
For this assignment, you'll be working with a CSV file containing information about Bluebikes trips. The file "bluebikes-data.csv" contains the following columns:
duration
: Length of the trip in secondsstart-station-name
: Name of the station where the trip beganstart-station-latitude
: Latitude coordinate of the starting stationstart-station-longitude
: Longitude coordinate of the starting stationend-station-name
: Name of the station where the trip endedend-station-latitude
: Latitude coordinate of the ending stationend-station-longitude
: Longitude coordinate of the ending station
Problem 1
Load the Bluebikes data from the CSV file into a table. Define a table called bike-table
with the appropriate column names and types. Be sure to include sanitize
clauses to convert numeric columns to numbers, e.g., sanitize duration using num-sanitizer
.
Problem 2
Many commuters use Bluebikes to travel between specific locations. Create a new table called porter-square-trips
that contains only the trips that started at "Danehy Park" and ended at "Porter Square Station".
Problem 3
Trip durations can vary widely. Design a function called duration-category
that takes a row from the bike table and returns a string categorizing the trip duration as "short", "medium", or "long" based on the following criteria:
- "short": less than 300 seconds
- "medium": between 300 and 500 seconds (inclusive)
- "long": greater than 500 seconds
Include a proper doc:
string that explains what the function does.
Then, use the build-column
function to create a new table called categorized-durations
that adds a "category" column to the original bike-table
.
Finally, create a bar chart called duration-bar-chart
that displays the frequency of each duration category.
Problem 4
For better readability, it's often helpful to convert trip durations from seconds to minutes. Design a function called seconds-to-minutes
that takes a number of seconds and returns the equivalent number of minutes. Include a doc:
string and test cases in a where:
block to demonstrate that your function works correctly.
Then, create a new table called table-with-minutes
that replaces the "duration" column in the original bike-table
with durations in minutes.
Problem 5
Imagine that you are on the Boston City Council and you are a member of the Committee on Planning, Development, and Transportation. Bluebikes has asked for your input about where they should install more bike stations, which will offer more riding opportunities for those living in, working in, or visiting those areas. We know that Bluebikes are used by a diverse group of people – residents, commuters, students, and visitors.
Consider the categorized-durations
from Problem 3. What might you be able to infer about the stakeholders for each category? Note: of course we cannot know for sure who or why someone was using a BlueBike from the duration of their trip, but thinking about possible differences in use can be a valuable step for thinking about who benefits from the service and the reasons for use.
Identify two unique categories of stakeholders for each duration. List at least one interest or value for each of those stakeholders.
categorized-durations | Possible stakeholders | Interests/Values |
---|---|---|
short | ||
medium | ||
long |
Write your response as a comment; you do not need to try to format it as a table, simply write:
# short: stakeholder1: cares about X
# short: stakeholder2: cares about Y
...
If, as a member of the Committee on Planning, Development, and Transportation, your priority is to reduce car traffic and to encourage commuters and visitors to use bikes instead of cars, where would you suggest the bike stations be built? Write your response as another comment:
# To reduce car traffic, we should build bike stations near ...
If, as a member of the committee, you want to make the city welcoming to and bikeable for tourists, where might you suggest the bike stations be built? Write your response as another comment.
# To make the city welcoming, we should build bike stations near ...