Transitioning to the IPython Notebook

Here at Software Carpentry we've been teaching Python for a little while. We teach Python in our bootcamps and we have a library of instructional videos on Python topics including basics, dictionaries, regular expressions, and object oriented programming.

As usual, though, we're not satisfied with the status quo. For both our bootcamps and our online material we're in the process of switching to the IPython Notebook. The Notebook lets the user write and execute Python code and see the results, all inside their favorite web browser.

Bootcamps

Software Carpentry bootcamp attendees are typically novice programmers who have yet to master many basic computational concepts. A priority when teaching Python to this audience is minimizing their mental load as they try to understand core concepts like loops, control flow, and functions. The Notebook offers several advantages for this audience while teaching Python in live, classroom settings:

These features allow students to spend nearly all of a learning session in the Notebook writing Python with a minimum of other distractions. The notebooks in which students work can be easily saved and reopened for later review.

Online Material

Software Carpentry's online material serves a broad audience from those interested in learning basic Python to those looking to learn more advanced topics like regular expressions or object oriented programming. Our current video based lessons can be effective for some, but videos make it difficult to browse or scan the material and code cannot be easily copied for later exploration or use. The IPython Notebook offers a wonderful format for these archived lessons for a number of reasons:

We are just beginning the process of converting our Python material to the IPython Notebook, but we currently have examples based on our while loop lecture and for graphing in Python. In the future we hope to have all of our current material available as Notebooks on our GitHub repository.

University Classrooms

The same benefits for presenting online material for the Software Carpentry site also extend to the providing lecture notes for university courses. When demonstrating programming concepts in class it is often beneficial for the students to be able to focus fully on what is being done, rather than attempting to take detailed notes on the specific examples being demonstrated. Notebooks can be posted to the web to allow students to go back and review the details of the implementation later. These can either be the actual Notebooks used in the classroom, giving the student an exact record of everything that was shown, or a pre-prepared notebook with similar material. One of us (EPW) has had reasonable good responses from students to using Notebooks in this fashion in two university courses.

As with workshops, one of the other major challenges for teaching beginning programmers in university courses is choosing a development environment that introduces as little additional cognitive load as possible. Based on Ethan's experiences this year he is planning on transitioning his introductory course from having students work in an Integrated Development Environment to having them work exclusively in Notebooks. Even in a simple IDE there is always substantial confusion about the differences between how the interactive prompt works and how it differs from code run from the editor. By switching to Notebooks the students will experience the benefits of both (as described above) without the additional load of trying to understand two different environments for running Python code.

(This post co-written by Matt Davis and Ethan White.)

Originally posted 2012-10-04 by Matt Davis in Content.

comments powered by Disqus