Python Numeric

Numeric is a Python module for high-performance, numeric computing. It provides much of the functionality and performance of commercial numeric software such as Matlab; in some cases, it provides more functionality than commercial software.

Download

The current version of Numeric is available from the SourceForge project page. Numeric is also included in many Linux distributions, such as Debian.

Documentation

The best source of documentation is the internal doc-strings, which can be accessed via the built-in Python help() function. The source code is also an excellent resource. Slightly out-of-date (but largely accurate) documentation is available in more accessible forms:

Mailing List

There is an excellent mailing list for discussion of both Numerical Python modules, Numeric and Numarray.

History

Numeric was originally written with performance as objective #1. Over time, it has become more "user friendly." However, certain design choices mean that it is not extremely efficient for very large data sets. This motivated some developers to create a new numerical Python module, numarray. Numarray makes different speed/performance tradeoffs than does Numeric; it is also a "younger" code-base. Some optimizations in Numeric have yet to make it into Numarray. Numeric may be faster for your application even if you work with very large data sets.

2/1/06 UPDATE A new, master module, named NumPy has been released that is touted as a replacement for Numeric and Numarray.

SciPy

SciPy adds a bunch of useful tools to Numeric. SciPy imports Numeric, so this line is all you need to start your python code:
  from scipy_base import *
The Debian SciPy package is python-scipy. I've found the best SciPy documentation to be the source code itself. On Debian, this is installed under /usr/lib/python2.3/site-packages/scipy.

Benchmarks

This benchmark set, originally written by Simon Burton, tests very basic functionality of Numeric, Numarray and Matlab.

ATLAS

To achieve the best performance with Numeric, it is important to use optimized BLAS and LAPACK libraries. ATLAS is one such optimized library that I have found to be effective. As of this writing (1/22/05), there is a bug in libc that can cause a floating point exception to be raised when special Pentium 3 and Pentium 4 instructions (SSE and SSE2) are executed. The Debian atlas3-sse2 package exhibits such problems. The Debian atlas3-base package does not have this problem and is no slower (according to the above benchmark code).

Disclaimer

I have not written a single line of code for the Numeric packages. I didn't create Numeric and I'm not a developer. I made this web page because I felt there was a lack of good repository of information about Numeric.

Created by Jason Rennie.
Last modified: Tue Jan 27 11:00:36 2009