Previous Section Next Section

15.8 Optional Numeric Modules

Many other modules are built on top of Numeric or cooperate with it. You can download some of them from the same URL as Numeric (http://sourceforge.net/projects/numpy). Some of these extra modules may already be included in the package you have downloaded. Documentation for the modules is also part of the documentation for Numeric. A rich library of scientific tools that work well with Numeric is SciPy, available at http://www.scipy.org. I highly recommend it if you are using Python for scientific or engineering computing.

Here are some key optional Numeric modules:

MLab

MLab supplies many Python functions written on top of Numeric. MLab's functions are similar in name and operation to functions supplied by the product Matlab.

FFT

FFT supplies Python-callable Fast Fourier Transforms (FFTs) of data held in Numeric arrays. FFT can wrap either the well-known FFTPACK Fortran-coded library or the compatible C-coded fftpack library.

LinearAlgebra

LinearAlgebra supplies Python-callable functions, operating on data held in Numeric arrays, that wrap either the well-known LAPACK Fortran-coded library or the compatible C-coded lapack_lite library. LinearAlgebra lets you invert matrices, solve linear systems, compute eigenvalues and eigenvectors, perform singular value decomposition, and least-squares-solve overdetermined linear systems.

RandomArray

RandomArray supplies fast, high-quality pseudo-random number generators, using various random distributions, that work with Numeric arrays.

MA

MA supports masked arrays (i.e., arrays that can have missing or invalid values). MA supplies a large subset of Numeric's functionality, albeit sometimes at reduced speed. The extra functionality of MA is the ability to associate to each array an optional mask, an auxiliary array of False and True, where True indicates array elements that are missing, unknown, or invalid. Computations propagate masks, and you can turn masked arrays into plain Numeric ones by using a fill-in value for invalid elements. MA is widely applicable because experimental data quite often has missing or inapplicable elements. Furthermore, when you need to extend or specialize some aspect of Numeric's behavior for your application's purposes, it often turns out to be simplest and most effective to start with MA's sources rather than with Numeric's. The latter are often quite hard to understand and modify, due to the extreme degree of optimization applied to them over the years.

    Previous Section Next Section