Universal Functions
Element-wise math functions:
np.sin(a) np.exp(a) np.sqrt(a) np.abs(a)
Why this matters
Universal functions (ufuncs) apply sin, exp, log, etc. to entire arrays as fast C loops. They are the building blocks of physics, finance, and ML transforms (activations, losses, feature scaling).
Composing ufuncs is how you keep numerical code expressive without dropping to element-wise Python.
ResourcesDocs, references & more — opens in a new tab
🎯 Your Task
Create angles = [0, π/6, π/4, π/3, π/2]. Compute sines = np.sin(angles). Print rounded to 2.
np.array([0, np.pi/6, np.pi/4, np.pi/3, np.pi/2])
⌘⏎ run · ⌘← → nav
▶ Output
Run your code to see output here.