The power of Python comes form thousands of modules which are shipped
with python or can be installed via python's package
manager. A package contains usually many modules.
The standard package manager of python is called “pip”
which downloads the package for you and installs it. This is not just
very convenient but also is safe because the download location is the
official python repository.
In general you import modules with the “import” command. For example
“import numpy as np” imports the module numpy into python and
abbreviates it as “np” so that you'd write “np.sin(c)” to call the
sine function in numpy.
The import command loads essentially a file
called “numpy.py” so that you can write your own modules just by
creating file with that name. See below in the “class” section for
an example. There are numerous ways how to import modules but the
“import as” way is by far the most popular.
Important modules are:
- numpy: Numerical operations for number crunching, matrix/array
operations, trigonometric functions, etc. It offers fast numerical
operations on arrays and matrices. It also has extensive Fourier
Transform commands.
- pylab: Plotting functions (MATLAB style), statistics and data fitting functions
- scipy: Scientific computing package. In particular we are insterested in
scipy.signal which contains all the signal processing functions and
filter design commands. It also offers Fourier Transforms, data io routines,
vector quantisation, linear algebra, optimisation tools and statistics.
github / contact