Chapter 3: SciPy Getting Started
SciPy Getting Started” is the section / guide that helps someone go from “I have Python installed” → “I can actually solve a real scientific / engineering problem with SciPy” in the shortest realistic time.
In Feb 2026 the official SciPy documentation does not have a standalone page called exactly “getting_started.html” anymore (it used to in older versions and gave 404 now). Instead, the modern entry point for new users is:
https://docs.scipy.org/doc/scipy/tutorial/index.html → called SciPy User Guide (but everyone mentally calls the first few pages “getting started”)
The very first page there is usually titled Introduction or links straight into subpackage tutorials.
So today I will teach you the practical 2026-style getting-started flow that experienced people actually recommend and use.
Step 0 — Prerequisites (must have before anything else)
- Python 3.10, 3.11, 3.12 or 3.13 (3.11–3.12 most common & stable in 2026)
- pip working (or conda/mamba if you prefer)
- Basic comfort with Jupyter notebook / VS Code + .py files
- Already know NumPy basics (arrays, slicing, broadcasting, np.linspace, np.random, basic math) → If not → first do NumPy quickstart: https://numpy.org/doc/stable/user/quickstart.html (takes ~30–60 min)
Step 1 — Installation (the 2026 recommended ways)
From https://scipy.org/install/ (current advice as of Feb 2026):
Best & fastest for most people (project-based, modern):
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# Option A – using uv (very fast, gaining huge popularity 2025–2026) pip install uv uv venv my-sci-env source my-sci-env/bin/activate # Windows: my-sci-env\Scripts\activate uv pip install scipy numpy matplotlib pandas jupyterlab # Option B – pixi (even nicer for cross-platform & reproducible) # Install pixi once: https://pixi.sh pixi init my-sci-project cd my-sci-project pixi add python scipy numpy matplotlib pandas jupyterlab pixi run jupyter lab |
Traditional & still very good:
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# conda / mamba (especially if you need non-Python deps like BLAS) conda create -n sci-env python=3.12 conda activate sci-env conda install scipy numpy matplotlib pandas jupyterlab -c conda-forge # or pure pip in fresh venv python -m venv sci-env source sci-env/bin/activate pip install --upgrade pip pip install scipy numpy matplotlib pandas jupyterlab |
Quick check after install:
|
0 1 2 3 4 5 6 7 |
import scipy print(scipy.__version__) # should show 1.17.x or newer in Feb 2026 |
Step 2 — The correct import style (very important – community convention)
Almost nobody does from scipy import * anymore.
Recommended patterns (2026 best practice):
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import numpy as np import scipy as sp # sometimes useful as shorthand # Most common – import only what you need (cleaner, faster tab-complete) from scipy import integrate, optimize, stats, interpolate, signal # or even more specific: from scipy.integrate import quad, solve_ivp from scipy.optimize import curve_fit, minimize from scipy.stats import norm, linregress |
Step 3 — Your first 5–7 “hello world” SciPy moments (do these today)
Open JupyterLab / notebook and run these one by one.
3.1 Numerical integration (the classic first example)
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 |
from scipy.integrate import quad import numpy as np def f(x): return np.sin(x)**3 / (1 + x**2) result, error = quad(f, 0, 20) print(f"Integral = {result:.6f} ± {error:.2e}") |
→ You just computed something almost impossible to do by hand.
3.2 Fit a model to fake “experimental” data (curve_fit – most used function!)
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from scipy.optimize import curve_fit import matplotlib.pyplot as plt xdata = np.linspace(0, 4, 50) ydata = 3.4 * np.exp(-1.2 * xdata) + 0.8 * np.random.randn(50) def exp_decay(x, A, tau): return A * np.exp(-x / tau) popt, pcov = curve_fit(exp_decay, xdata, ydata, p0=[3, 1]) print(f"Fitted A = {popt[0]:.3f}, τ = {popt[1]:.3f}") plt.plot(xdata, ydata, 'o', label='data') plt.plot(xdata, exp_decay(xdata, *popt), '-', lw=2.5, label='fit') plt.legend(); plt.grid(alpha=0.3); plt.show() |
This pattern solves thousands of real lab / field / business problems.
3.3 Solve a differential equation (solve_ivp – modern solver)
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from scipy.integrate import solve_ivp import numpy as np def damped_oscillator(t, y, zeta): x, v = y return [v, -2*zeta*v - x] # m=1, k=1, damping = 2*zeta sol = solve_ivp(damped_oscillator, [0, 20], [2.0, 0.0], args=(0.3,), t_eval=np.linspace(0, 20, 400)) plt.plot(sol.t, sol.y[0], label='position') plt.plot(sol.t, sol.y[1], label='velocity') plt.xlabel('Time'); plt.grid(alpha=0.3); plt.legend() plt.title("Damped harmonic oscillator (ζ = 0.3)") plt.show() |
3.4 Quick statistics & distribution play
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from scipy import stats data = stats.norm.rvs(loc=172, scale=8, size=120) # fake heights in cm mu, sigma = stats.norm.fit(data) print(f"Mean = {mu:.1f} cm, std = {sigma:.1f} cm") # One-sample t-test example t_stat, p_value = stats.ttest_1samp(data, popmean=175) print(f"p-value = {p_value:.4f} → {'significant' if p_value<0.05 else 'not significant'} difference from 175 cm") |
Step 4 — Where to go next (realistic learning path)
After these examples, most people follow this order:
- Read Introduction → https://docs.scipy.org/doc/scipy/tutorial/general.html
- Skim the User Guide index → https://docs.scipy.org/doc/scipy/tutorial/index.html
- Pick one topic that matches your need and do its tutorial:
- scipy.optimize (curve_fit, minimize)
- scipy.integrate (quad + solve_ivp)
- scipy.stats
- scipy.signal or scipy.interpolate
- Keep https://docs.scipy.org/doc/scipy/reference/ open (API reference) — use search a lot
- Use ? or ?? in Jupyter: curve_fit? or curve_fit??
Teacher’s closing advice (from experience)
- Don’t read everything — pick one problem type → solve it → repeat
- curve_fit + solve_ivp + stats.linregress solve ~65% of beginner/mid-level needs
- Errors about BLAS/LAPACK? → reinstall with conda-forge or use uv/pixi
- SciPy moves slowly → code from 2020 usually still works in 2026
Which of these examples felt most useful / closest to what you actually want to do? Optimization? ODEs? Fitting real data? Statistics? Signal filtering?
Tell me and we’ll do a deeper 20–40 line realistic example together right now. 🚀
