Many additional Python packages and modules have been developed by the community to further extend Python. They are available for separate download and installation. Again, a comprehensive list is beyond the scope of our presentation, but several are of interest to anyone engaged in scientific computing because they provide efficient implementations of computationally intensive tasks.

How do you take advantage of the Python community’s work in scientific programming? The answer starts with NumPy, SciPy, and all things Py. Modules like these make it possible to create highly performing scientific and engineering applications within Python. The core libraries underlying NumPy, SciPy, and their kin are actually coded in C and Fortran rather than Python in order to achieve compiled-code speed in low-level operations and (especially) memory access patterns. Moreover, they are typically linked to optimized implementations of the BLAS and LAPACK libraries, which incorporate decades of research on numerical methods for linear algebra.

NumPy provides various mathematical capabilities to Python, notably including fast handling of multi-dimensional arrays but also including trigonometry functions, curve fitting, sorting and searching, Fourier transforms, and general linear algebra. Note that NumPy supersedes older modules (Numeric and NumArray) that you might find mentioned on the Internet.

SciPy leverages NumPy’s treatment of multi-dimensional arrays to include higher-level capabilities for optimization, integration, interpolation, and signal and image processing. It provides some of the same functionality as MATLAB or Octave. Matplotlib provides powerful plotting tools similar to those provided by MATLAB. And the list goes on: Rpy2 is an interface to the R statistics package, MySQLdb provides access to MySQL databases,, etc.

An easy way to obtain many of the popular modules for scientific computing is to download and install one of the larger Python distributions such as those provided by Anaconda or Enthought. For more details on NumPy, SciPy, and distributions, see the Virtual Workshop presentation on Python for High Performance and the section specifically on Third-Party Libraries. An excellent repository of many python packages is PyPI (the Python Package Index). The (current) standard Python package manager, pip, defaults to PyPI for access to remote packages.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement