, , ,

Using Python Notebooks to Build Students’ Skills, Confidence and Knowledge

Data Labs in the Classroom:

Teaching Tips from the Community

Dr. Sean Crosby, OOI Data Lab Fellow 2020


I am an adjunct at Western Washington University (WWU), and a coastal oceanographer for the U. S. Geological Survey. I work with a range of students and colleagues from Geology to Environmental Sciences, as my research focuses on physical processes at the shoreline including nearshore hydrodynamics, waves, and morphology.

At WWU, I teach a course on the Salish Sea estuary to undergraduates studying a wide range of environmental sciences. Here, I emphasize the importance of physical processes and their links to the region’s biological productivity and contaminant concentrations. My students have an introductory knowledge of oceanography and typically limited experience with data manipulation and scripting.

In addition to providing students with an introductory understanding of estuarine physics and bio-geo-chemical interactions, I want students to take away some basic data analysis skills and the confidence to dive into datasets to explore their own questions.

I have found that providing a simple platform, like python notebooks, to examine observational and model data is critical to maintaining student interest and engagement. When needing to teach remotely, Google Colabs, a cloud-based python-notebook platform, has been a life-saver, allowing students to work on any computer without installing anything.

I developed several python notebooks to introduce students to working with data using this platform including:

  • the Coastal Transport notebook that illustrates the effect of coastal winds on coastal ocean properties (upwelling / downwelling), and
  • the Estuary Circulation notebook that explores how these properties are ultimately transmitted with estuarine exchange circulation.

Learning Goals

Beyond becoming familiar with python notebooks, and gaining confidence visualizing ocean data, the primary content goal of the lessons was to introduce students to changes in water column properties due to upwelling and downwelling dynamics, and the role of tides and stratification in controlling estuarine exchange flow.

satellite image of Salish Sea estuary

Satellite image of Salish Sea estuary; https://en.wikipedia.org/wiki/Salish_Sea


While these two processes are distinct (one coastal, another estuarine), I aim to ultimately show students how they are connected. Though the Salish Sea (right) is a large and complex estuary, students will take away a few underlying concepts that control its dynamics.





Implementation and Python Notebooks

The lesson was designed to be taught synchronously with periods of instruction followed by individual or student-group work. This was successful with remote-learning using Google Colabs, but unsurprisingly would be more efficient face-to-face in a computer lab.

The lessons should be adapted based on the scripting experience of the students; it is currently designed for students with limited to no coding experience.

  • If students have no coding experience I recommend spending a day with one of many introductory python resources online, or the introductory notebook in my repository, Python Ocean Lessons.
  • For students with some experience there are many ways to expand the lesson and data analysis components; in most lessons there is a “going further” section that is unstructured and requires some coding experience.

Each lesson encourages students to explore the physical concepts (upwelling/downwelling, exchange flow) by developing initial hypotheses from what they see in the data.

(top) Observed daily-averaged wind speeds and directions along the Washington coast. (bottom) Ocean temperature, in color, through depth and time of coastal waters on the Washington shelf.

Students then discuss in small groups or with the class. Through discussion and instructor guidance, students ultimately arrive at the driving physical mechanisms.

In class, I encourage students to make mistakes and wild conjectures – in order to realize that with real-world observations, it can be difficult to elucidate the mechanics as the true system dynamics are usually quite complex.

Notes on Datasets Used

Teaching Tips

Allocate more time than expected

In general, I recommend allocating more time for:

  1. technical hurdles such as file management or python installations (if not using Google Colabs)
  2. student interpretation of plots and hypothesis generation
  3. student syntax errors in scripting

There are tips in the repository for (1) and (2), but I like to encourage students to utilize the internet to help solve issues with (3), allowing them to build confidence in their scripting troubleshooting, which is often 90% of coding anyhow.

Promote Student Collaboration

When teaching remotely, break-out rooms are extremely useful in encouraging students to see each other as resources and promotes collaboration. Many aspects of scripting are difficult, and I find that frustration is lower when students are allowed to struggle together.

Challenge Your Students

There is a difficult compromise to be made between providing students with enough pre-written code to make some progress, without providing them so much that there is no challenge left.

I find that students are excited when they overcome plotting hurdles, especially when they are making 2D heatmaps that have a high level of detail and are, science aside, aesthetically pleasing. These kinds of milestones may drive further investigation and student learning.

The notebooks I developed err on the side of providing too much, with the intent that another instructor may adapt it to suit the level of their students.


A collection of notebooks and tools are available in a github repository, Python Ocean Lessons. The lessons discussed in this blog post were Coastal Transport and Estuary Circulation and include instructor guides.

The repository itself contains additional resources for introducing python notebooks, working with Google Colabs, and using git-hub. Please see the README for an overview.