The NumPy module provides hundreds of useful mathematical
functions, as well as constants like
e (the base of natural
There are two ways to make these functions and constants available to your program.
If your program is primarily doing computation, and you
don't use a lot of other modules, place this statement
with the other
import statements at the
top of your script, and it will add all the names from
NumPy module to your namespace.
from numpy import *
You can then refer directly to the constants like
pi and functions like
>>> from numpy import * >>> print pi, e 3.14159265359 2.71828182846 >>> print arange(0.0, 1.0, 0.1) [ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]