Next / Previous / Contents / TCC Help System / NM Tech homepage


An introduction to some common functions of NumPy, a numerical computation module for the Python programming language.

This publication is available in Web form and also as a PDF document. Please forward any comments to

Table of Contents

1. Introduction
2. Importing NumPy
2.1. Adding NumPy to your namespace
2.2. Practicing safe namespace hygiene
3. Basic types
4. ndarray: The N-dimensional array
4.1. One-dimensional arrays
4.2. The arange() function: Arithmetic progression
4.3. Two-dimensional arrays
4.4. Three or more dimensions
4.5. Array attributes
4.6. Array methods
5. Universal functions (ufuncs)
6. Dot and cross products
7. Linear algebra functions

1. Introduction

The purpose of Python's NumPy module is to bring Python's power and elegance to bear on mathematical and scientific problems.

Major parts of this product include:

  • NumPy provides basic numerical functions, especially for multi-dimensional arrays and mathematical computation.

  • SciPy builds on NumPy to provide features for scientific applications.

  • matplotlib provides plotting and related graphic display capabilities. Its function set is intended to be quickly usable by people who are familiar with Matlab, although it is built entirely on top of Python and thus can be integrated with any other Python-based application.

  • ipython is an enhanced conversational interface that allows you to interact with Python in parallel with a running application.

The starting point on the Web is The documentation page takes you to almost complete documentation, but the full PDF-formatted manual is available only by purchase. Purchasing the manual supports the ongoing development and maintenance of the product.

NMT has purchased the manual, Travis E. Oliphant's Guide to NumPy. This PDF document is available only from sites in the domain; please respect the restricted terms of distribution as described on the first page.

To make life a little easier for those just starting out, the present document is an attempt to present a few of the most basic concepts and facilities in a tutorial. Before undertaking any significant projects, please at least skim the table of contents of Dr. Oliphant's full documentation: there is a lot of functionality there that might save you a lot of work.