1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Learning for Time Series Data in Python

Connected

Exercise

Using "date" information

It's easy to think of timestamps as pure numbers, but don't forget they generally correspond to things that happen in the real world. That means there's often extra information encoded in the data such as "is it a weekday?" or "what quarter is it?". This information is often useful in predicting timeseries data.

In this exercise, you'll extract these date/time based features. A single time series has been loaded in a variable called prices.

Instructions

100 XP
  • Calculate the day of the week, month of the year, and quarter of the year.
  • Add each one as a column to the prices_perc DataFrame, under the names day_of_week, month_of_year and quarter_of_year, respectively.