NumPy
The array library nearly all scientific Python builds on.
NumPy is taught here in 12 lessons, running from NumPy arrays through to Debugging array code: shape errors and NumPy 2 pitfalls. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.
| Track | Python & Data Science |
| Lessons | 12 |
| Level | Beginner to intermediate |
| Reading time | about 3 hours |
| Prerequisites | Helpful, but not required: Python 3 |
Lessons
- NumPy arraysWhy ndarray exists, how shapes and dtypes work, and how to create arrays in the ways you will actually use.
- Indexing, slicing and masksBasic slicing, views versus copies, boolean masks and fancy indexing — plus the assignment rule that catches everyone.
- Vectorised maths and broadcastingElement-wise operations, the ufunc model, aggregation, and the broadcasting rules that make array code concise.
- Reshaping, stacking and splittingreshape, transpose, concatenate and split — how to move data between shapes without copying more than necessary.
- Views, copies and memory layoutHow NumPy shares memory between arrays, what C and Fortran order really mean, and how to stop copying gigabytes by accident.
- Sorting, searching and set operationsSort along the axis you mean, find insertion points without a loop, and use NumPy's set routines for joins and membership.
- Linear algebra with numpy.linalgMatrix products, solving systems without inverting them, and the decompositions that answer real questions reliably.
- Random number generation with the Generator APIUse default_rng correctly, pick the right distribution, and make results reproducible without poisoning global state.
- File I/O: save, load, npz and memory-mapped arraysPersist arrays without losing dtype or shape, read text files robustly, and work with arrays that do not fit in memory.
- Structured arrays, datetimes and string dtypesRecord-like arrays, calendar arithmetic with datetime64, and the fixed-width string type that quietly truncates your data.
- Performance: einsum, ufunc tricks and avoiding copiesExpress awkward tensor contractions readably, cut temporary allocations with in-place operations, and know when tuned C is worth it.
- Debugging array code: shape errors and NumPy 2 pitfallsRead broadcast errors without guessing, find the axis bug, and avoid the numeric and API traps that NumPy 2 introduced.
More in Python & Data Science
Python 3 pandas Matplotlib Jupyter Notebook Flask FastAPI Django SciPy Pillow Python 2.x R Julia
FAQ
How long does the NumPy course take?
It has 12 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for NumPy?
Not strictly. It helps to have read Python 3 first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after NumPy?
Continue with pandas (12 lessons), the next course in Python & Data Science.
Last refreshed 2026-09-18.