Detailed lessons#

There are many free Python tutorials online; a quick search will produce a very long list. For example, Python Basics: Introduction to Python features many detailed lessons from https://realpython.com, which I find to be a great source for Python in-depth learning. Project Pythia Foundations has a great collection of more advanced tutorials especially geared for the earth sciences, including Oceanography.

Instead of creating learning materials from scratch, we’ll take advantage of The Carpentries, https://carpentries.org, “a global community teaching foundational computational and data science skills to researchers in academia, industry and government.” Carpentries tutorials and lessons are openly accessible.

Specifically, we’ll use the Plotting and Programming in Python lesson from The Carpentries: “This lesson is an introduction to programming in Python 3 for people with little or no previous programming experience.” It’s also referred to as the “gapminder” lesson, based on the dataset it uses.

Note

Another, similar Carpentries lesson that you may find helpful is Programming with Python: “The best way to learn how to program is to do something useful, so this introduction to Python is built around a common scientific task: data analysis.”

Getting the Data#

The data we will use is taken from the gapminder dataset. To obtain it, download and unzip the file python-novice-gapminder-data.zip. In order to follow the presented material, you should launch JupyterLab in the folder that contains the unzipped ddadta file. (see Starting JupyterLab).

Lesson episodes#

The Plotting and Programming in Python lesson is intended as a workshop that takes a full day. We will go through a subset of the materials (referred to as “episodes”) and will only highlight some specific points within each episode. The goal is to examine in more detail most of the Python and programming elements we saw in the previous “Quick overview”.

The basics#

– Break and Q/A#

More advanced topics#

The key points from each episode are summarized here

– Break and Q/A#