TDM 10100: Project 6 — Fall 2026
-
Dates, Date-Times, Timestamps, and Libraries in Python and R for Date-Time Conversions
Motivation: We learn about working with dates and times, in both Python and R
Context: Both languages provide several types of tools for working with dates and times.
Scope: dates and times in Python and R
Dataset(s)
This project will use the following datasets:
-
/anvil/projects/tdm/data/icecream/combined/reviews.csv -
/anvil/projects/tdm/data/bay_area_bike_share/baywheels/202507-baywheels-tripdata.csv -
/anvil/projects/tdm/data/consumer_complaints/complaints.csv
|
In this project, please only use 2 cores in your Jupyter Lab session: (do not use 4 cores or 16 cores for this project) |
Questions
Question 1 (2 pts)
In R, if you use the lubridate library, there is an official Cheatsheet available from Posit (the company that makes RStudio) available here:
and it is also available in pdf format:
These cheat sheets are loaded with a variety of information!
Please consider our examples, which demonstrate how to use a few of these functions:
After you finish considering those examples, read the data from the ice cream reviews into an R data frame, using fread:
/anvil/projects/tdm/data/icecream/combined/reviews.csv
On which date were the most reviews written? How many reviews were written on that date?
Make a plot that shows the number of reviews per date, for the whole data set.
Make a second plot that shows the number of reviews per date, but only for the dates in June 2018.
-
On which date were the most reviews written?
-
How many reviews were written on that date?
-
Make a plot that shows the number of reviews per date, for the whole data set.
-
Make a second plot that shows the number of reviews per date, but only for the dates in June 2018.
-
As always, be sure to document your work from Question 1 (and from all of the questions!), using some comments and insights about your work. We will stop adding this note to document your work, but please remember, we always assume that you will document every single question with your comments and your insights.
Question 2 (2 pts)
In the Bay Area Bike Share Baywheels data from July 2025:
/anvil/projects/tdm/data/bay_area_bike_share/baywheels/202507-baywheels-tripdata.csv
find the average length of bicycle trips, by subtracting the started_at time from the ended_at time.
There are altogether 388168 bike rides in this data set. Once you have calculated the average time of a bike ride, find the number of bike rides that were longer than the average length.
-
Find the average length of bicycle trips in July 2025.
-
Find the number of bike rides that were longer than the average length.
Question 3 (2 pts)
Read in only the Date received column from the Consumer Complains data:
/anvil/projects/tdm/data/consumer_complaints/complaints.csv
On which date did the most complaints occur? How many complaints occurred on that date?
Make a plot that shows the number of complaints per date, but only for the dates in February 2025.
-
On which date did the most complaints occur?
-
How many complaints occurred on that date?
-
Make a plot that shows the number of complaints per date, but only for the dates in February 2025.
Question 4 (2 pts)
Now switch from the seminar-r kernel to the seminar kernel, and work in Python, for questions 4 and 5.
Please consider our examples, which demonstrate how to accomplish similar tasks in Python instead of R:
Solve Question 1 again, but this time using Python.
-
Solve Question 1 again, but this time using Python.
Submitting your Work
Please make sure that you added comments for each question, which explain your thinking about your method of solving each question. Please also make sure that your work is your own work, and that any outside sources (people, internet pages, generative AI, etc.) are cited properly in the project template.
Prior to submitting your work, you need to put your work into the project template, and re-run all of the code in Jupyter Lab and make sure that the results of running that code is visible in your template. Please check the detailed instructions on how to ensure that your submission is formatted correctly. To download your completed project, you can right-click on the file in the file explorer and click 'download'.
Once you upload your submission to Gradescope, make sure that everything appears as you would expect to ensure that you don’t lose any points. We hope your first project with us went well, and we look forward to continuing to learn with you on future projects!!
-
firstname_lastname_project6.ipynb
|
It is necessary to document your work, with comments about each solution. All of your work needs to be your own work, with citations to any source that you used. Please make sure that your work is your own work, and that any outside sources (people, internet pages, generative AI, etc.) are cited properly in the project template. You must double check your Please take the time to double check your work. See here for instructions on how to double check this. You will not receive full credit if your |