Callysto.ca Banner

Module 6 Unit 5 - Data Analysis and the Jupyter Notebook#

Unit Learning Objectives#

By the end of this unit, you will be able to

  • Perform data analysis in a Jupyter Notebook

  • Create your own Jupyter Notebook that analyzes data

Why use Jupyter Notebooks to Analyze Data?#

Jupyter Notebook was developed in part as a way to communicate the methods and results of data analysis in a single document, including information such as data, executable code and statistics alongside written explanations.

An example of how this is valuable, consider if your assignment was to assess whether your favorite NHL team was on track to make the playoffs. Without using Jupyter Notebooks, you approach would likely involve

  • Copying data from hockey stats website such as hockey-reference.com and pasting it into a spreadsheet

  • Making a graph from the tabular data

  • Using a word processor such as Microsoft Word or GoogleDoc to write a report based on the static snapshot of how that team was doing at that moment in time.

  • Copying the graph you made and pasting it into the report.

  • Using a Jupyter Notebook, creating a report is not only easier, but more comprehensive for the reader. In a single document you can

Use Python programming to connect to live data source being updated real-time

  • Write up an explanation of the data analysis in adjacent cell blocks

  • Choose to represent how the team is doing using either static or live data

  • If using live data, you can design the document to remain relevant, even if you were to come back to the notebook next month or year

  • Create graphs directly inside the notebook

  • Make those graphs interactive so readers can further explore the data for themselves

External Activity: Data Analysis Exercises#

The following two notebooks have been made available to you through github.com.

There isn’t one standard way to download Jupyter Notebooks from the various sites that are used to host/share them. In this case you can follow the instructions below. Otherwise, we recommend that you check out the FAQ for each site.

  1. Click on the link.

  2. Click on Raw

  3. Press Ctrl+S (PC) or Command+S (Mac) to save the file. If the file comes up with a .txt extension, change the Format to All files and Delete the .txt extension in the filename.

  4. Follow the instructions that were provided in Module 4 Unit 5 to add the file to your Callysto Hub.

  5. Don’t forget to Click Run All to view the Notebook.

Notebook 1: NHL Data

Work through this Notebook to find out how the process described above plays out in a Jupyter Notebook.

callysto/getting-started

Try changing teams and years to see if your team is on playoff pace.

Notebook 2: Lab Report Template Tutorial

Work through Callysto’s lab report template tutorial to get familiar with how you can create your own data or work with data from a different source and create a table and graph.

callysto/curriculum-notebooks

Reflections#

Callysto.ca License