Recall & Review
beginner
What does the
np.convolve() function do in numpy?It calculates the convolution of two one-dimensional arrays, combining them to produce a third array that represents how one modifies or overlaps the other.
Click to reveal answer
beginner
What are the typical inputs to
np.convolve()?Two one-dimensional arrays (signals or sequences) that you want to combine through convolution.
Click to reveal answer
intermediate
Explain the difference between the 'full', 'valid', and 'same' modes in
np.convolve().- full: Returns the complete convolution, including parts where arrays partially overlap.
- valid: Returns only parts where arrays fully overlap.
- same: Returns output the same size as the first array, centered.
Click to reveal answer
beginner
Why is convolution useful in data science and signal processing?
Convolution helps to blend or filter signals, detect patterns, smooth data, or apply effects like blurring in images.
Click to reveal answer
intermediate
How does
np.convolve() relate to moving averages?A moving average is a convolution where one array is the data and the other is a simple averaging filter (like equal weights).
Click to reveal answer
What is the output length of
np.convolve(a, b, mode='full') if a has length 5 and b has length 3?✗ Incorrect
The 'full' mode output length is len(a) + len(b) - 1, so 5 + 3 - 1 = 7.
Which
np.convolve() mode returns an output the same size as the first input array?✗ Incorrect
The 'same' mode returns an output array with the same length as the first input.
If you want to smooth noisy data using convolution, what kind of second array (kernel) would you use?
✗ Incorrect
Equal weights average the data points, smoothing the noise.
What does convolution measure between two arrays?
✗ Incorrect
Convolution measures how one array overlaps and modifies the other.
Which numpy function would you use to perform convolution?
✗ Incorrect
np.convolve() is the function for convolution in numpy.
Describe in your own words what convolution is and how
np.convolve() works.Think about how one signal can slide over another and combine values.
You got /4 concepts.
Explain the difference between the 'full', 'valid', and 'same' modes in
np.convolve() and when you might use each.Consider output size and how much overlap you want.
You got /4 concepts.