← Quiz: Time Series with pandas: all 10 questions
Quiz: Time Series with pandas · Question 7 of 10
In the moving-average forecast, why is .shift(1) applied after rolling(7).mean()?
In the moving-average forecast, why is .shift(1) applied after rolling(7).mean()?
- A.So the forecast for a day uses only the 7 days before it, not the day itself
- B.To remove the weekday pattern
- C.To convert it to percent
- D.To make the series longer
Answer & explanation
Correct answer: So the forecast for a day uses only the 7 days before it, not the day itself
Without it, the "forecast" would include the actual value it is predicting.
Can you get the rest right without peeking?
Take the timed Quiz: Time Series with pandas quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →