Introduction
NumPy gives you fast arrays and basic math on them. SciPy is built directly on top of those arrays and adds the actual scientific-computing tools: optimization, statistics, linear algebra solvers, signal processing, and more — the things you'd otherwise have to implement by hand.
SciPy is a collection, not one flat library
Unlike a library where everything lives at the top level, SciPy is organized into separate sub-packages, each covering one area: scipy.optimize, scipy.stats, scipy.linalg, scipy.interpolate, and several others this course doesn't cover (like scipy.signal for signal processing). You import the specific sub-package you need, rather than the whole library at once.
from scipy import constants print(constants.c)
299792458.0
from scipy import constants pulls in just the constants sub-package. constants.c is the speed of light in meters per second — one of dozens of physical constants SciPy ships with, which the next lesson covers properly.
import scipy on its own does not give you access to scipy.optimize, scipy.stats, or the other sub-packages — each one has to be imported explicitly, either as from scipy import stats or import scipy.stats. This trips up people coming from NumPy, where import numpy as np really does hand you everything under np..Checking what's installed
SciPy depends on NumPy being installed, and the two are almost always installed together. A quick version check confirms both are available:
import scipy import numpy print(scipy.__version__) print(numpy.__version__)
1.13.0 1.26.4
(Your exact version numbers will differ depending on when you installed SciPy — what matters is that both imports succeed without an error.) If SciPy isn't installed yet, pip install scipy pulls in NumPy automatically as a dependency.
The sub-packages this course covers
Five sub-packages, one lesson each: scipy.constants for physical constants and unit conversions, scipy.optimize for finding a function's minimum, scipy.stats for probability distributions and descriptive statistics, scipy.linalg for solving systems of linear equations, and scipy.interpolate for estimating values between known data points. Each lesson stands mostly on its own, so once you've got the import pattern above, feel free to jump to whichever one you actually need.