← Quiz: Time Series with pandas: all 10 questions
Quiz: Time Series with pandas · Question 4 of 10
What does this print? (code)
What does this print?
import pandas as pd
s = pd.Series([100, 120, 90])
print(s.pct_change().round(2).tolist()[1:])
- A.[20, -30]
- B.[1.2, 0.75]
- C.[0.2, -0.25]
- D.[0.2, -0.3]
Answer & explanation
Correct answer: [0.2, -0.25]
120/100 − 1 = 0.2 and 90/120 − 1 = −0.25.
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 →