Recall & Review
beginner
What does the
ewm() function in pandas do?The
ewm() function calculates the exponential weighted moving average of data, giving more weight to recent values and less to older ones.Click to reveal answer
beginner
What parameter in
ewm() controls how much weight recent data points get?The
span parameter controls the decay, determining how quickly older data points' influence decreases.Click to reveal answer
beginner
How do you apply the exponential moving average after calling
ewm()?You call a method like
.mean() on the result of ewm() to get the exponential moving average values.Click to reveal answer
intermediate
Why use exponential moving average instead of simple moving average?
Exponential moving average reacts faster to recent changes because it gives more weight to recent data, unlike simple moving average which weighs all points equally.
Click to reveal answer
intermediate
What does the
adjust parameter do in ewm()?The
adjust parameter controls whether the calculation uses weighted averages with adjustment (True) or a recursive formula (False).Click to reveal answer
What does
ewm(span=5).mean() compute on a pandas Series?✗ Incorrect
ewm(span=5).mean() calculates the exponential moving average giving more weight to recent points, controlled by span=5.
Which parameter in
ewm() changes how quickly older data loses influence?✗ Incorrect
The span parameter controls the decay rate of weights for older data points.
If
adjust=False in ewm(), what happens?✗ Incorrect
adjust=False uses a recursive formula for calculation without bias correction.
What is the main benefit of exponential moving average over simple moving average?
✗ Incorrect
Exponential moving average reacts faster to recent data by weighting recent points more.
Which pandas method do you call after
ewm() to get the average values?✗ Incorrect
You call mean() to compute the exponential weighted moving average values.
Explain how the
ewm() function works and why it is useful in analyzing time series data.Think about how recent data points should influence your analysis more than older points.
You got /4 concepts.
Describe the role of the
span and adjust parameters in the ewm() function.Consider how these parameters affect the weight distribution and calculation style.
You got /3 concepts.