Recall & Review
beginner
What does the numpy function np.sin() compute?
The function np.sin() computes the sine of each element in the input array, where the input is in radians.
Click to reveal answer
beginner
How is the cosine function represented in numpy?
The cosine function is represented by np.cos(), which calculates the cosine of each input value in radians.
Click to reveal answer
beginner
What is the output of np.tan(np.pi / 4)?
The output is 1.0 because the tangent of 45 degrees (π/4 radians) is 1.
Click to reveal answer
intermediate
Why do numpy trigonometric functions expect input in radians, not degrees?
Because radians are the standard unit for angles in mathematical functions and calculations, numpy functions like np.sin(), np.cos(), and np.tan() expect input in radians for accuracy and consistency.
Click to reveal answer
beginner
How can you convert degrees to radians before using numpy trigonometric functions?
You can convert degrees to radians using np.radians(degrees), which converts degree values to radians for use in np.sin(), np.cos(), and np.tan().
Click to reveal answer
What does np.cos(np.pi) return?
✗ Incorrect
The cosine of π radians (180 degrees) is -1.0.
Which numpy function calculates the tangent of an angle?
✗ Incorrect
np.tan() calculates the tangent of each element in the input array.
If you have an angle in degrees, which function helps convert it to radians?
✗ Incorrect
np.radians() converts degrees to radians, which is needed for trigonometric functions.
What is the value of np.sin(0)?
✗ Incorrect
The sine of 0 radians is 0.
Which unit should angles be in when using np.sin(), np.cos(), or np.tan()?
✗ Incorrect
Numpy trigonometric functions expect angles in radians.
Explain how to calculate the sine, cosine, and tangent of an angle using numpy, including any necessary unit conversions.
Think about the input unit and the numpy functions for each trig function.
You got /3 concepts.
Describe a real-life example where you might use numpy's trigonometric functions in data science.
Consider situations involving cycles or angles.
You got /3 concepts.