Using Google Forms and Jupyter Notebooks to Track Time in Medical School
This post is part of Time Habits of a Medical Student, hit the hyperlink to see the other posts in the series
I am starting medical school at the University of Minnesota later this summer and am very interested in how medical students spend their time. In order to gain a better understanding of how I use my own time, I have been putting a number of services and code to automatically keep tabs on where my time is being put towards. In case those automated methods do not work or at the very least to determine how accurate they are, I have also created a system to manually keep track of my studies. Below, I will outline the steps I took and provide code for those interested in doing it themselves.
First, I created a Google Form categorizing the types of activities medical students do including Class, Lab, Anki, Self-Study, Volunteering, and Research. With the form, I specify the date the time is being entered for along with the amount of time in minutes for each category.
If you would like to replicate this project, it would probably be easiest to create a Google form that exactly matches the one I created. Specifically, each category is named:
Enter date for time entered
Class Time
Lab Time
Anki (as recorded in app)
Volunteering
Research
Other (Group Study, Committees, Shadowing, etc.)
Self Study (not including Anki)
To cut down on the chance of error, each one of the form fields only accepts a numerical entry. If you would like to create your own categories, feel free to use the Jupyter Notebook as a general template. However, the variables will not match and much of the Notebook will need to be recoded.
The time and categories automatically feed into a Google spreadsheet that allows for further analysis.
While in the spreadsheet, I then navigated to File →Publish to the Web. Within the window that pops up, I selected the downward arrow next to the tab that says “Web page” and then selected Comma-separated values, then I copied the link below that. This link will allow Jupyter Notebooks to read the data from the spreadsheet.
From there I created a script within Jupyter Notebooks (LINK TO GITHUB) that reads the data, creates additional column values, and then creates and saves graphs breaking down time spent by day of the week, month, and year locally. In addition, it creates and saves graphs breaking down the former time variables by the category of time. Finally, the code provides the sum of time per date and the sum of time per date broken down by category. You need to post the URL you copied from Google sheets as a string for path (cell #2 of notebook). If you run the kernel, the below images should show up and save to your working directory.
I am excited to see what kinds of insights I can gather from this data. If you decide to do a similar project, let me know how it goes!
Updates to Jupyter Notebook Script
- Google Changed their API which requires downloading the Google sheet and then reading in the sheet from a local file rather than from a URL.
- Added additional information to the descriptive statistics section.
- Added additional figures: total time by week, total time by year in school, total time by school term, and a pie chart of time by category.
The link to the script above is still functional and to my knowledge, there are no additional inputs needed.
Find me
LinkedIn: https://www.linkedin.com/in/chris-hornung/
Twitter: https://twitter.com/ChrisHornung
Github: https://github.com/ChristyHorn14