Chapter 1 Β· Section 4 practice

Time-series Features and Resampling

0 of 4 answered

These questions review the examples in the companion slides. Choose an answer, then check the explanation.

Question 1

weather[β€œdate”].iloc[0] right after pd.read_csv is a …

  • str
  • Timestamp
  • datetime64
  • int (days since 1970)

Question 2

msft.shift(1).iloc[0] is …

  • The first close
  • NaN
  • The second close
  • The last close

Question 3

(1 + r).cumprod().iloc[-1] equals …

  • The sum of all returns
  • The last price
  • Last price Γ· first price β€” growth of one dollar
  • The mean return Γ— number of days

Question 4

msft.resample(β€œME”).mean() β€” what is the first index value?

  • 2015-01-02, the first trading day
  • 2015-01-31, the calendar month end
  • 2015-01-15, the midpoint
  • 2015-01, a month period