NumPy Learning Roadmap
A structured path from NumPy beginner to expert — with milestones, time estimates, and what to build at each stage.
Why NumPy
NumPy is the foundation of Python’s scientific computing stack. pandas, scikit-learn, PyTorch, and TensorFlow all use NumPy arrays at their core. Without NumPy fluency, you’ll fight your tools instead of solving problems.
Stage 1: Array Fundamentals (Week 1)
Goal: Create, index, and manipulate arrays without looking at docs.
Topics:
- Introduction to NumPy — what arrays are, why not lists
- Arrays and Dtypes — shapes, dtypes, memory layout
- Indexing and Slicing — fancy indexing, boolean masks, views vs copies
Milestone: Write a function that takes a 2D array of student scores and returns per-student grades, class averages per subject, and a pass/fail mask — using only array operations, no loops.
Stage 2: Computation Patterns (Week 2)
Goal: Write vectorized code instead of Python loops.
Topics:
- Broadcasting — shape rules, outer products, adding dimensions
- Universal Functions — ufunc methods, at(), reduceat()
- Vectorization — benchmark loops vs vectorized, when to profile
Milestone: Implement pairwise cosine similarity for N vectors using broadcasting only (no loops, no sklearn).
Stage 3: Math and Algorithms (Week 3)
Goal: Use NumPy for linear algebra, statistics, and matrix operations.
Topics:
- Matrix Operations — dot, matmul, einsum
- Linear Algebra — SVD, eigenvalues, solving linear systems
- Random and Simulation — Generator API, Monte Carlo, bootstrap
Milestone: Implement PCA from scratch: center data, compute covariance, eigen-decompose, project to k components. Verify against sklearn’s PCA.
Stage 4: Performance and Scale (Week 4)
Goal: Write NumPy code that performs well on large datasets.
Topics:
- Performance Optimization — memory layout, copy vs view, profiling
Milestone: Benchmark 5 implementations of a sliding window mean: pure Python loop, numpy loop, stride tricks, and vectorized diff. Understand where each beats the others.
Stage 5: Projects
Beginner: Statistics calculator, grade book analyzer, dice simulator
Intermediate: K-Means from scratch, image compression via SVD, Monte Carlo options pricing
Advanced: Backpropagation engine, numerical ODE solver, FFT-based convolution
See NumPy Projects for full descriptions.
What Comes After NumPy
- pandas — tabular data built on NumPy arrays
- scikit-learn — ML algorithms that consume NumPy arrays
- PyTorch / TensorFlow — deep learning frameworks with NumPy-like APIs
- SciPy — scientific algorithms (optimization, signal processing, statistics)
Resources
- Official NumPy documentation and User Guide
- “Python for Data Analysis” by Wes McKinney (chapters 4-5)
- NumPy’s own tutorial: numpy.org/doc/stable/user/quickstart.html