pycon logo

PyCon 2011 Atlanta

March 9th–17th

Log in or Sign Up

Scientific Python Tools not only for Scientists and Engineers

log in to bookmark this presentaton

Experienced / Tutorial
March 9th 9 a.m. – 12:20 p.m.
Python provides numerous tools for scientific and engineering applications. This is an overview of the most widely used libraries including NumPy, matplotlib and tools for interfacing with C/FORTRAN. They are not only useful for scientists and engineers but also for programmers who need to do number crunching, simple yet powerful plotting of diagrams or interfacing with compiled languages.

Abstract

Intended Audience

Python programmers with intermediate knowledge. Scientists and engineers with a good working knowledge of Python.

Tutorial Format

Lecture/Class

This tutorial is a mixture of lecture and class. Since it is designed as an overview and therefore covers a great many different tools, we cannot go too much into details. Students can work along but there is not enough time to do in-class excerices. They have to be done as homework.

All source codes are provided on CD before the course. There is a comprehensive handout detailing all presented topics including in-depth discussions of all code examples. This should enable the students to complete the exerceise on their own.

Class Size

This is in a combined lecture/class format and will work with a larger crowd. Parts of t were presented at EuroSciPy 2010 in Paris to about 50+ people without problems.

Requirements

All participants should bring laptops with Linux, Windows, or Mac OS. Python 2.6 or 2.5 (2.7 might work in March) as well as an editor or IDE will need to be installed .

The following third-party packages are needed:

  • NumPy (version 1.3 or higher)
  • matplotlib (version 1.0 or higher)
  • IPython (version 0.10 or higher)
  • Cython (version 0.13 or higher)
  • C and FORTRAN compiler (e.g. GCC and gfortran)

Windows users

The Python(x,y) distribution contains all packages listed above including the compilers and makes installation very simple.

If you have the Entough Python Distribution (EPD) installed you should also be all set.

Testscript

A test script will be provided by the instructor. If it runs through without complaining all necessary packages are installed. Otherwise it will prompt to install the missing package(s).

Notes for Reviewers

This tutorial is based on my three-day course "Python for Scientists and Engineers". I've been teaching this course since 2008 several times a year both as an open course as well as major parts of it incorporated in on-site courses for companies and research institutes.

Unlike the course that goes quite into detail and has exercise for all major topics, the tutorial focuses on the main concepts teaching the students what each library is good for with some typical examples.

Parts of this tutorial have been given at EuroSciPy 2010 in Paris, France.

Outline for Review

  • Science and Python (15 min)
    • Short history of scientific tools in Python + Scientific Python + Numeric
    • Examples for scientfic users
    • Overview of some current tools
  • NumPy (45 min)
    • The array processing package
    • Array construction
    • Indexing and slicing
    • Broadcasting
    • Universal functions
  • SciPy (15 min)
    • Overview of packages
  • matplotlib (30 min)
    • pylab and IPython
    • Simple plots
    • Properties
    • Text and ticks
    • Figures, subplots and axes
    • Types of plots
  • Working with external processes (20 min)
    • Generating input
    • Starting processes
    • Reading output
  • Extending Python with C and FORTRAN (55 min)
    • ctypes
    • Cython
    • f2py
      • F90 module data
      • Callbacks
      • Modules

Outline for Website

  • Science and Python
    • Short history of scientific tools in Python
      • Scientific Python
      • Numeric
    • Examples for scientfic users
    • Overview of some current tools
  • NumPy
    • The array processing package
    • Array construction
    • Indexing and slicing
    • Broadcasting
    • Universal functions
  • SciPy
    • Overview of packages
  • matplotlib
    • pylab and IPython
    • Simple plots
    • Properties
    • Text and ticks
    • Figures, subplots and axes
    • Types of plots
  • Working with external processes
    • Generating input
    • Starting processes
    • Reading output
  • Extending Python with C and FORTRAN
    • ctypes
    • Cython
    • f2py
      • F90 module data
      • Callbacks
      • Modules