1.C. Scipy Tutorial
1.C. Scipy Tutorial
History
Python was expanded in the 1990s to include an array type for numerical computing
called numeric. This numeric package was replaced by Numpy (blend of Numeric
and NumArray) in 2006. There was a growing number of extension module and
developers were interested to create a complete environment for scientific and
technical computing.
Travis Oliphant, Eric Jones, and Pearu Peterson merged code they had written and
called the new package SciPy. The newly created package provided a standard
collection of common numerical operation on the top of Numpy.
Numpy and SciPy both are used for mathematical and numerical analysis. Numpy is
suitable for basic operations such as sorting, indexing and many more because it
contains array data, whereas SciPy consists of all the numeric data.
Numpy contains many functions that are used to resolve the linear algebra, Fourier
transforms, etc. whereas SciPy library contains full featured version of the linear
algebra module as well many other numerical algorithms.
SciPy Sub - Packages
SciPy has the number of sub-packages for the various scientific computing domains.
The following table is given below:
5. scipy.interpolation Interpolation
SciPy Constant
1. pi pi
Consider the following example of scipy.constant. Here we compare the 'pi' value by importing
different modules.
Output:
The above code will give the following output. As we can observe that both values are same.
Physical Constants
The scipy.constant package provides the number of physical constants. The most
commonly used physical constants are the following:
5. E Elementry charge
It is difficult to remember all units; the few essential constants are listed below:
1. Mass
3. Length
4. Pressure
5. Area
The scipy.constant provides the find() function, which returns a list of physical_constant keys
containing a given string.
Output:
['Boltzmann constant',
'Boltzmann constant in Hz/K',
'Boltzmann constant in eV/K',
'Boltzmann constant in inverse meters per kelvin',
'Stefan-Boltzmann constant']