Chapter 5. Advanced Computing with SciPy, Numba, and NumbaPro

In this chapter, the user will learn how to use SciPy to perform scientific computations. The Numba package will then be introduced as a way to accelerate computations. Finally, the NumbaPro capabilities of parallel execution in the GPU will be presented.

In this chapter, we will cover the following topics:

  • Overview of SciPy
  • Advanced mathematical algorithms with SciPy
  • Accelerating computations with Numba and NumbaPro

Before running the examples in this chapter, load pylab by running the following command in a computing cell:

%pylab inline

Overview of SciPy

SciPy is an extensive library for applied mathematics and scientific computation. The following is the complete list of all the modules available in the library:

Module

Functionality

cluster

Clustering algorithms

constants

Physical and mathematical constants

fftpack

Fast Fourier Transform

integrate

Integration and ordinary differential equations

interpolate

Interpolation and splines

io

Input and output

linalg

Linear algebra

ndimage

Image processing

odr

Orthogonal distance regression

optimize

Optimization and root-finding

signal

Signal processing

sparse

Sparse matrices

spatial

Spatial data structures

special

Special functions

stats

Statistical distributions

weave

C/C++ integration

The standard way to import SciPy modules in scripts is using the following command line:

from scipy import signal

Then, individual functions can be called with the usual module reference syntax, as follows:

signal.correlate(…)

However, many of the most used functions are available at the top level of the SciPy hierarchy. Also, we use IPython in the interactive mode and use (as we assume in this book) the magic, as follows:

%pylab inline

Many of the functions will be available without explicit module reference.

In the next section, we present a sample of the functions available in SciPy. The reader is not expected to know the mathematical techniques and algorithms that will be used in the examples in depth.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset