M4401 Honours Computing Course 2010

Python

About

Python is a free, modern programming language which is a good option for many scientific computational modelling and data analysis tasks. It can be used interactively or programmatically.

There are many useful packages for Python for manipulating fixed-point decimals, rational types, algebraic types, arrays, vectors, tensors, hooking into GPIB instruments, reading all manner of data formats including Matlab data files, CDF, HDF, image formats etc.

Getting Started

If you know nothing about Python, do the tutorial in the python help or start with one of these books:

The following book is reportedly the best 'learning to program' book ever written. There may be some hyperbolae attached to this claim:

For people wanting to use python for science, it's easiest to use one of the (rather large) single-installer distributions, Enthought Python or Python(x,y), instead of the standard python or ActivePython versions. Enthought Python is free for academic use and supports Windows, Linux, and Mac OS-X. Python(x,y) is completely free and supports Windows and Linux (not Mac OS-X yet).

Next look at http://www.scipy.org, the home on the web for all things scientific to do with Python. The links to the Example List, IDL/Matlab/Python cross reference, tutorials and numpy and scipy API documentation are useful. This page is also good. And this tutorial "Practical Scientific Computing in Python" looks very promising.

Now that MIT's introductory programming course uses Python, they have course material and video lectures available.

Scientific Packages

These packages are included in the Enthought edition installer, but power users will want to use the most recent versions.

Scientific Python References

The scipy documentation page is the starting point for documentation on numpy and scipy

The book: Hans Petter Langtangen, Python scripting for computational science, 3rd ed., 2009, Hargrave 005.133 P999 LAN 2009 Langtangen also has a teaching-oriented book, Primer on Scientific Programming with Python, Springer, 2009, Hargrave Electronic text.

There are quite a few streamable videos online. See, for example, the SciPy 2009 conference sessions, UC Berkeley 2-day workshop on Python for scientific computing, Enthought Scientific Computing with Python Webinars, and Machine Learning Open Source Software'08 conference.

Editors

There are many IDE's and editors. Some recommended ones are

Just for Astronomers