Install Scipy by .....................
You can load the Scipy module into python and activate all SciPy functions by
>>>import scipy >>>from scipy import *
Now your Python is equipped with sub packages for Signal processing, Fourier transform, statistical analysis, and packages for calculus etc. For complete list of sub-packages in SciPy, hit the command help('scipy') in IDLE
You can import Scipy sub-packages that are needed for the program instead of all packages in Scipy.
For example,
>>> from scipy import linalg >>>A=mat('23,24;25,26') # to create a matrix >>>mat(A).I # Inverse of matrix A
A polynomial can be represented by
>>>eq=poly1d([1,-5,6])
Now let’s see some operations on the polynomial
>>>print eq # to print polynomial >>>roots(eq) # roots of polynomial
Let us see how will the definite integrals can be find out using Scipy
>>>print eq.integ(k=4) #integral of eq with constant of integration 4 >>>print eq.deriv() # derivative of eq
More function in linear algebra and matrix operations can be obtained by importing scipy.linalg model into python
>>>from scipy.linalg import * >>>A=matrix([[5,2,4],[-3,6,2],[3,-3,1]]) >>>A.T # Traspose of matrix >>>A.I # Inverse of matrix A >>>eigval,eigvect=eig(A) >>>eigval # Eigen values of matrix A >>>eigvect # Eigen vector of matrix A
There are much more linear algebra functions available in this library. But explaining all of them are out of scope for this practitioner workbench. Please go through the documentation and try yourself.
The statistical tool box consists of statistical functions. The data from a Numpy array or in the word file can be imported into python and we can find mean, median, variance, correlation etc
Have a look at some of the examples
>>>x=arange(-10.,10.,1) # define a array >>>mean(x) # mean >>>var(x) # variance >>>amin(x) # minimum value in observation >>>amax(x) # maximum value in observation >>>std(x) # standard deviation of observation