Open workspace
Tools 1.4Code walkthrough9 parts

Vectorised Operations and Broadcasting

Compute on whole arrays at once, and predict when shapes combine.

Loading your progress…Next: 1.5 Aggregations Along Axes

In this lesson9 parts

  1. 01Two shops on different scales, and why the raw numbers mislead
  2. 02Standardising with a Python loop, one column at a time
  3. 03An array and a scalar, applied to every element
  4. 04Two arrays of the same shape, and universal functions
  5. 05The broadcasting rule: shapes lined up from the right, equal or one
  6. 06Subtracting a row of column means, and standardising in one line
  7. 07Subtracting per day: the broadcast error, and adding an axis with None
  8. 08A broadcast that runs and answers the wrong question, and allclose
  9. 09Recap and your challenge