🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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:])
  1. A.[20, -30]
  2. B.[1.2, 0.75]
  3. C.[0.2, -0.25]
  4. 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 →