Child pages
  • Python & SciPy 0.7.1

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

All CHPC Software

...

SciPy is an open-source mathematical module for Python. It can be compared to other mathematical packages such as Matlab, IDL, Octave, SciLab. SciPy requires the installation of NumPy which provides its multi-dimensional array datastructure.

Features

SciPy contains the following sub-packages

cluster

Clustering algorithms

constants

Physical & math constants

fftpack

Fast Fourier Transform

integrate

Integration & ODE solvers

interpolate

Interpolation and smoothing splines

io

Input/Output

linalg

Linear algebra

maxentropy

Maximum entropy methods

ndimage

N-dim. image proc.

odr

Orthog. dist. regression

optimize

Optim. & root-finding

signal

Signal processing

sparse

Sparse matrices

spatial

Spatial data structures

special

Special functions

stats

Statistical distributions

weave

C/C++ integration

How to invoke NumPy & SciPy?

The NumPy & SciPy libraries have been built with a specific Python distribution (in casu Python version 2.5.4). Therefore, the NumPy & SciPy libraries will only be recognized when the following Python executable will be invoked:
/uufs/Documentation has been moved: https://www.chpc.utah.edu/sysdocumentation/pkgsoftware/python/2.5.4/bin/python2.5

Example

Assume we want to calculate the following integral (Latex notation):
\frac{\sqrt{2\,\pi}}\,\int_{-\infty}^{+\infty}\,\exp{-x^2/2}\,dx

then we must proceed in the following way:

Invoke the Python executable:

source /uufs/index.php

This includes a searchable database found: https://www.chpc.utah.edu/sys/pkg/python/2.6.5so/etc/python.sh (Bash)

source /uufs/chpc.utah.edu/sys/pkg/python/2.6.5so/etc/python.csh (Tcsh)

Code Block
python
import numpy
import scipy
from scipy import integrate
from scipy.integrate import quad, inf
from math import pi, sqrt, expPerform the calculation:
quad(lambda x: 1/(sqrt(2.0*pi)) * exp(-x*x/2.),-inf,inf)

Documentation

NumPy and SciPy Documentation
Last Modified: November 23, 2009 @ 11:32:56

software/chpc/