- About
- Getting Started
- Scientific Packages
- Scientific Python References
- Useful Modules and bits of code
- Editors
- Just for Astronomers

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.

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

- Chris Fehily, Python, c2002, Hargrave 005.133 P999 FEH 2002
- Mark Lutz and David Ascher, Learning Python, Hargrave 005.133 P999 LUT 2004
- David Beazley, Python Essential Reference, 2006, Hargrave 005.133 P999 BEA 2006

- John Zelle, Python Programming: An Introduction to Computer Science, Gippsland 005.133 P999 ZEL 2004

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.

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

- numpy is the general nd-array package for Python.
- scipy implements a bunch of numerical methods for doing root finding, filtering, fitting, solving, transforming, image processing, I/O etc.
- matplotlib is the standard 2D plotting package for use with numpy/scipy. The gallery shows you many examples of plots, with the code that generated them.

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.

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

- The iPython shell (installs with Enthought Python) - Windows and Linux.
- PyScripter - try this if you're using Windows. If you get an error when trying to run PyScripter?, see this comment.
- PyDevwith the Eclipse IDE - Windows and Linux.
- The SciTE editor - Windows and Linux.

- The Stsci interactive data analysis in astronomy tutorial
- University of Bonn Python for Astronomers course
- The Astronomical Python (AstroPy) site