SciPy appears to provide most (but not all [1]) of NumPy\'s functions in its own namespace. In other words, if there\'s a function named numpy.foo
, there\'s alm
From Lectures on 'Quantitative Economics'
SciPy is a package that contains various tools that are built on top of NumPy, using its array data type and related functionality
In fact, when we import SciPy we also get NumPy, as can be seen from the SciPy initialization file
# Import numpy symbols to scipy name space
import numpy as _num
linalg = None
from numpy import *
from numpy.random import rand, randn
from numpy.fft import fft, ifft
from numpy.lib.scimath import *
__all__ = []
__all__ += _num.__all__
__all__ += ['randn', 'rand', 'fft', 'ifft']
del _num
# Remove the linalg imported from numpy so that the scipy.linalg package can be
# imported.
del linalg
__all__.remove('linalg')
However, it’s more common and better practice to use NumPy functionality explicitly
import numpy as np
a = np.identity(3)
What is useful in SciPy is the functionality in its subpackages