Numerical Python
|
Numerical Python (often abbreviated NumPy) is an extension to the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays. Numerical Python was originally created by Jim Hugunin but it is open source and has many contributors.
There are actually two different implementations of Numerical Python. The original one, Numeric, which is reasonably complete and stable, remains available, but is no longer supported. The newer implementation, Numarray, is a complete rewrite of Numerical Python. The differences, while substantial, are implementation details; the rest of this discussion applies to both.
Because Python is an interpreted language, mathematical algorithms often run much slower than they do in compiled languages like C or even Java. Numerical Python addresses this problem for many numerical algorithms by providing multidimensional arrays and lots of functions and operators that operate on arrays. Thus any algorithm that can be expressed primarily as operations on arrays and matrices can run almost as fast as the equivalent C code.
Some see Numerical Python as a good free alternative to MATLAB, since MATLAB's programming language is similar in some superficial ways to Numerical Python: they are both interpreted, and they both allow the user to write fast programs as long as most operations work on arrays or matrices instead of scalars. MATLAB has the mathematical advantage in that it has many thousands of built-in mathematical functions and many more available as commercial products, while Numerical Python has the advantage that Python is a more modern and complete programming language, and it is also open source. SciPy is a library that adds more MATLAB-like functionality.
External links
- Numarray website (http://www.stsci.edu/resources/software_hardware/numarray)
- Numerical Python website (http://www.pfdubois.com/numpy/) Old implementation, obsolescent
- SciPy (Built on Numeric) website (http://www.scipy.org)