Conference site » Proceedings

Advanced Scientific Python Tutorials

UPDATE: Please note change of rooms below. The advanced tutorials will be held at the Beckman Institute and the introductory ones at Moore 070 (the original plan was the reverse). The Registration Desk will be open daily in the Beckman Institute Courtyard, 7:30 a.m. - 9:00 a.m. This is also where the coffee break service will be provided.


The advanced tutorial will take place in the Beckman Institute auditorium. You can see it marked on this map of the campus that lists all relevant buildings for the conference. Interactive and printable maps of the Caltech campus can also be found on Caltech's website, on those maps Beckman is building #74.

The Registration Desk will be open daily in the Beckman Institute Courtyard, 7:30 a.m. - 9:00 a.m. This is also where the coffee break service will be provided.


The SciPy'09 tutorials contains both an introductory and an advanced track. This page provides details on the advanced track, which consists of the following 8 presentations (2 hours each):


  • Morning:
    • 8:00-8:30. Optional startup session where the organizers will try to assist with any last-minute setup or installation problems.
    • 8:30-10:20. Advanced numpy: Stefan van der Walt and David Cournapeau.
    • 10:20-10:40. Break.
    • 10:40-12:30. Advanced topics in matplotlib: John Hunter
  • Lunch break (on your own): 12:30-2:00.
  • Afternoon:
    • 2:00-3:50. Symbolic computing with sympy: Ondrej Certik.
    • 3:50-4:10. Break.
    • 4:10-6:00. Statistics with Scipy: Robert Kern.


  • Morning:
    • 8:00-8:30. Optional startup session where the organizers will try to assist with any last-minute setup or installation problems.
    • 8:30-10:20. Cython: Dag Sverre Seljebotn.
    • 10:20-10:40. Break.
    • 10:40-12:30. Using GPUs with PyCUDA: Nicolas Pinto.
  • Lunch break (on your own): 12:30-2:00.
  • Afternoon:
    • 2:00-3:50. Designing scientific interfaces with Traits: Enthought.
    • 3:50-4:10. Break.
    • 4:10-6:00. Mayavi/TVTK: Prabhu Ramachandran.


The software tools and installation options listed on the introductory tutorials page are necessary for the advanced ones here, though a few of the advanced tutorials may need extra software to be installed, as listed below.

Once you have installed the necessary packages, you may want to download and run this checklist script. It will do some sanity checks on your system, and if it finds a problem, it will generate a reasonably detailed report you can mail for help. We will try to assist you with fixing any problems you may run into before the actual conference starts, to save time and hassles.

Tutorial descriptions

Advanced NumPy

Presented by Stefan Van der Walt and David Cournapeau

Numpy is the N-dimensional array package that underlies most scientific programming in Python. The goal of this tutorial is to present advanced uses and features of NumPy, including:

  • Strides and broadcasting
  • (Neighbourhood) iterators
  • Generalised ufuncs
  • Debugging and building with numscons

Pre-requisites: numpy 1.3.0, numscons 0.10 for the numscons section.

Advanced topics in matplotlib

Presented by John Hunter

Many people interact with matplotlib through the matlab-like pylab interface, but there are lots of useful but underutilized advanced features and techniques under the hood. This tutorial will explore these areas, focusing on hands on interactive examples covering

  • new features: mplot3d, fancy annotations and axis spines
  • text properties including mathtext
  • advanced date handling in plots
  • custom tick locating and formatting
  • interactive plotting - picking figure elements and working the mouse and keyboard
  • working with transformations and paths

Symbolic computing with sympy

Presented by Ondrej Certik

The tutorial will cover:

  • basic introduction to sympy
  • how to use sympy in the terminal and Sage (SPD) notebook
  • how to download, how to work with git, create and prepare patches, switch branches, contribute to sympy (or any other git project)
  • how to use sympy with other libraries (scipy, numpy), how to hook things into ipython
  • how to create custom printers (e.g. special pretty printer, code generation etc.)
  • how to run sympy on the google app engine
  • numeric evaluation (to any precision) of integrals, sums and other expressions
  • how to traverse the sympy expression and do transformation on it
  • symbolic equations solving

Pre-requisites: sympy 0.6.4 or later (the version in EPD should be ok too)

Statistics with Scipy

Presented by Robert Kern

This tutorial presents the statistical capabilities of Numpy and Scipy.

  • Numpy's pseudorandom number generators
  • Scipy's probability distribution objects
  • Statistical tests and summary statistics
  • Nonlinear regression
  • Kernel density estimation
  • Tips and tricks

Pre-requisites: numpy 1.3.0, scipy 0.7.0. Some capabilities from the development version of scipy will be shown.

Writing optimized extensions with Cython

Presented by Dag Sverre Seljebotn

In many ways Python is an ideal language for scientific programing, but being interpreted it often lacks the speed of C or Fortran needed for doing low-level data manipulation. Cython is a Python to C compiler that allows one to write C-speed code in a Python environment, as well as wrap existing C libraries. In this tutorial you will learn how to write and compile Cython code, use Cython as a bridge between Python and external libraries, and common pitfalls to avoid.

Prerequisites: This is an interactive session. Attendees should come with Cython 0.11.2 installed, see for instructions.

Using GPUs with PyCUDA

Presented by Nicolas Pinto and prepared in collaboration with Andreas Klöckner.

Supercomputing on your desktop (or notebook) using Python!

Writing reliable GPU codes that achieve peak performance in the face of changing requirements and hardware platforms can be a challenging task. In this tutorial, we'll show that it is possible to achieve a favorable balance between ease of programming (Python) and raw computing speed using cheap commodity graphics hardware (Nvidia GPUs). We'll introduce the open-source PyCUDA toolkit, which, aside from being a Python language binding for CUDA, enables easy run-time code generation and empirical optimization as a solution to these concerns. PyCUDA covers "small-scale" and "large-scale" uses alike: It allows quick prototyping and experimentation, but it also integrates easily into large-scale computational software. Further, PyCUDA can generate code for many common operations, saving debugging and coding time.

Prerequisites: Part of this session will be interactive, attendees are encouraged to come with PyCUDA 0.93 (available on PyPi, see the FAQ; Nvidia GPU required) and Cheetah >= 2.2.1 installed. Please use the following script to test your set-up.

3D visualization with Mayavi

Presented by Prabhu Ramachandran.

Mayavi provides mlab which makes it extremely easy to perform 3D visualization using numpy arrays. We first expose the user to the mlab interface and use it to motivate and expose the rest of the more complex Mayavi library and application. We also show one may easily embed 3D visualization into a traits based application. This tutorial will follow the one on Traits so prior knowledge of Traits is not needed.

Here is a rough outline of the tutorial session.

  • mlab
    • Simple plotting for numpy arrays
    • Introduction to the notion of a pipeline
  • The mayavi objects
    • The Engine and object-oriented control of a pipeline
    • Data sources used in Mayavi
  • Embedding Mayavi in a traits based UI.

We will provide a more detailed outline of the tutorial soon.

Pre-requisites: Mayavi-3.2.0 or greater is highly recommended. Installing the latest version of EPD will work for Win32 and Mac OS X. Pythonxy will also work but EPD will definitely be tested. Under Linux, the latest Ubuntu and Debian ship packages for Mayavi but these may be dated see Mayavi install instructions for more information.