One Reference for Many Rows

Each greenhouse has its own target temperature. We want to compare every day's readings with those three targets without copying the targets into a new table by hand.

10 sections · 4 questions · 2 coding challenges

1 / 10

Repeating a Calculation Without Repeating Its Data

BOTIE

Array calculations often combine a large collection with a smaller reference: one scale for all entries, or one target for each feature column. Explicitly constructing a second large table adds work and obscures that the reference is shared.

NumPy's broadcasting rules specify when smaller shapes can be reused across larger ones. Our greenhouse example illustrates one such case. It is not a claim that NumPy understands the meaning of the columns; matching the references to the right columns remains our responsibility.

Sources for this history