This lecture by Aron Ahmadia and David Ketcheson is licensed under a Creative Commons Attribution 4.0 International License. All code examples are also licensed under the MIT license.
from IPython.core.display import HTML
css_file = './example.css'
HTML(open(css_file, "r").read())
This course is about how to use IPython notebooks in teaching. It's based on our experience teaching semester-length university courses as well as short courses for academia and industry. Although the examples will be drawn from courses on numerical methods, many of the ideas may be useful for other courses in which Python is used.
A course in numerical methods should enable students to:
Many courses focus almost entirely on the first objective, but all four are essential. It's worth devoting significant time in class to each of them. That means that students should code in class. The IPython notebook is a great tool for this.
Notebooks can also be used in a more traditional course; for instance
The notebook combines in a single document
We'll go into this in more detail in a few minutes.
The IPython notebook is already being used as a medium of instruction for courses in numerical methods or scientific computing:
More course materials (in many subjects!), can be found in this curated list:
This tutorial is primarily focused on the technical aspects of using IPython notebooks for teaching. For more discussion of pedagogical aspects, see also:
An even more painless solution is to use a cloud service. Two cloud services for running IPython notebooks are currently available:
Both allow free accounts, and include all the most common scientific Python packages by default.
If you keep your materials in a Github repository, students can easily get them using Sage Math Cloud (without knowing git) or by cloning (with knowing git).
A dead simple way to distribute a notebook is by using Dropbox and nbviewer. Just put the notebook in your public Dropbox folder, get the public link to it, and paste that into nbviewer. Give the resulting URL to your students, and they can both view and download the notebook. For example, here is a link to this notebook on nbviewer through Dropbox.
Another very useful tool for distributing notebooks is gist.