Importing modules
The steps to load some of the important modules are as follows:
- To load
NumPy
and matplotlib to work interactively, along with inline graphics, run the following command:pylab inline
- To load
NumPy
and matplotlib without importing names into the current namespace, with inline graphics, run the following command line:pylab -–no-import-all inline
- To load
SciPy
modules, use any of the following standard Python import commands:import scipy.<module> import scipy.<module> as <local-name> from scipy.<module> import <function>
If the –no-import-all
options is used, the functions and objects have to be prefixed by the appropriate module name as follows:
- For
NumPy
functions and objects, usenumpy
ornp
. - For interactive graphics, use
pyplot
orplt
.
Modules from libraries installed in the system as well as the user-created modules with the.py
extension can be imported through the standard Python mechanism.