The NumPy Numerical Extensions to Python

NumPy is a nickname for a package of Numerical Extensions to Python. These extensions add two powerful new types to Python, a new sequence type which implements multidimensional arrays efficiently, (multiarray) and a new type of function called a universal function (ufunc) which works efficiently on the new arrays and other sequence types. These new objects give Python the number crunching power of numeric languages like MATLAB and IDL while maintaining all of the advantages which Python has as a general-purpose programming language. It's also free, just like the rest of Python.

What's in NumPy?

The core of NumPy is a pair of new types, which allows efficient operations on potentially very large arrays of numbers, A simple example is:
   >>> from Numeric import *              # load NumPy
   >>> xs = arange(-6, 6, .02)            # create X indices
   >>> ys = arange(-6, 6, .02)[:,NewAxis] # create Y indices
   >>> sinx = sin(xs)                     # sin() on each element of xs
   >>> yx = cos(ys)*exp(-ys*ys/18.0)      # same sort of thing
   >>> zx = xs * xs                       # elementwise multiplication
which results in an array zs which looks something like:

In addition to the two core data types and a set of functions operating on them, three commonly used packages are included:
  • LinearAlgebra, an interface to the LAPACK library for linear algebra operations (including eigenvalues, singular value decomposition, etc.).
  • FFT, an interface to the FFTPACK library for Fast Fourier Transforms.
  • RandomArray, a general-purpose Random Number Generator.
For more detailed information, see the documentation page.

Where can one get NumPy?

See the SourceForge Project page..

History

NumPy was primarily designed and implemented by Jim Hugunin, based on early work by Jim Fulton, and with the help of the (now-defunct) Matrix-SIG.

Since Jim moved on to CNRI to work on JPython, and then to Xerox PARC to work on AspectJ, the maintenance of NumPy was been transferred to one of its most heavy users, the Computer Science Team, X-Division, Lawrence Livermore National Laboratory.

In 2000, NumPy development was moved to a new home page at SourceForge.

Contact Information

For questions, feedback, support and bug reports, please refer to the NumPy Project Page at SourceForge.