A short course in Python
Department of Earth System Science, Tsinghua University

A quick introduction and practical examples of Python programming to climate science problems. The exercises are taken from various iterations of the Atmosphere–Ocean Interactions class. Many of these require additional data that I cannot provide here. If you are attempting to complete these exercises and are unable to find or generate appropriate data for them, please contact me directly. Notes and scripts for topic 7 (eofs and windspharm) are in preparation. In the meantime, please see Andrew Dawson's excellent documentation pages for these modules.

  1. Introduction to the Python programming environment (native data types and structures, functions and modules, numpy, basic plots)
    [notes] [scripts (zip)] [exercises]
  2. Continuing introduction to Python (csv, dynamical modeling, more numpy and plotting)
    [notes] [scripts (zip)] [exercises]
  3. Python Data Analysis Library (pandas, seaborn)
    [notes] [scripts (zip)] [exercises]
  4. Simple climate modeling in Python (CliMT)
    [notes] [scripts (zip)]
  5. A practical example based on this paper (netCDF4, linear regression, significance testing, maps)
    [notes] [scripts (zip)] [exercises]
  6. The SciTools suite (iris, cartopy)
    [notes] [scripts (zip)] [exercises]
  7. More ways to build on iris (eofs, windspharm)
    [notes] [scripts (zip)] [exercises]