scipy array tip sheet

Arrays are the central datatype introduced in the SciPy package. (The same array objects are accessible within the NumPy package, which is a subset of SciPy. For consistency, we will simplify refer to to SciPy, although some of the online documentation makes reference to NumPy. And technically, array objects are of type ndarray, which stands for "n-dimensional array".) The array interface is accessible by importing the scipy module: import scipy. Arrays are similar in some respects to Python lists, but are multidimensional, homogeneous in type, and support compact and efficient array-level manipulations. Documentation can be found online at www.scipy.org/Documentation, which also includes links to NumPy Examples (sample usage for many functions) and NumPy for MATLAB Users, if you're so inclined.

Constructing arrays

Indexing arrays

Slicing arrays (extracting subsections)

Element-wise functions on arrays

Summation of arrays

Various other useful functions and methods (see NumPy Examples at www.scipy.org/Numpy_Example_List_With_Doc)

Many of these work both as separate functions (scipy.blah(a)) as well as array methods (a.blah()).