Chapter 1 Β· Section 4 practice
Time-series Features and Resampling
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 β¦
strTimestampdatetime64int(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 day2015-01-31, the calendar month end2015-01-15, the midpoint2015-01, a month period