Lesson 8
Element-wise Math
Operators work element-by-element:
a + b # [11, 22, 33] a * b # [10, 40, 90] a ** 2 # [1, 4, 9]
This is vectorization.
Why this matters
Vectorization is the reason NumPy feels like "math on whole arrays": one expression, many elements, compiled loops underneath. It is the default style in scientific Python and a prerequisite for readable ML code.
Keeping code in this form also makes GPU frameworks and batch APIs easier to adopt later.
ResourcesDocs, references & more โ opens in a new tab
๐ฏ Your Task
Given temps_f = np.array([32,68,100,212]), compute temps_c = (F-32)*5/9.
(temps_f - 32) * 5 / 9
โโ run ยท โโ โ nav
โถ Output
Run your code to see output here.