Tools 1.4Lesson outlineLesson 4 of 7 in Module 1
Vectorised Operations and Broadcasting
Compute on whole arrays at once, and predict when shapes combine.
Free sample. Everything in this module opens with a free account.Video in production.
Lesson outline: Vectorised Operations and Broadcasting
In this lesson9 parts
- 01Two shops on different scales, and why the raw numbers mislead
- 02Standardising with a Python loop, one column at a time
- 03An array and a scalar, applied to every element
- 04Two arrays of the same shape, and universal functions
- 05The broadcasting rule: shapes lined up from the right, equal or one
- 06Subtracting a row of column means, and standardising in one line
- 07Subtracting per day: the broadcast error, and adding an axis with None
- 08A broadcast that runs and answers the wrong question, and allclose
- 09Recap and your challenge
Key terms: Vectorised Operations and Broadcasting
The words this lesson introduces, each in one line. The module’s glossary collects them all, and the AI glossary has every term across the courses.
- Vectorisation
- Applying an operation to an entire array instead of a Python loop over its elements
- Universal function
- NumPy function applying an operation elementwise
- Broadcasting
- Matching dimensions from the right, repeating a size-one dimension conceptually
Quiz: Vectorised Operations and Broadcasting
Your first pick on each question is the one that counts. Getting one wrong here is how the lesson sticks.