Session Ready
Exercise

Multiple time series slices (2)

In this exercise, you will use the same time series aapl from the previous exercise and plot tighter views of the data.

  • Partial string indexing works without slicing as well. For instance, using my_time_series['1995'], my_time_series['1999-05'], and my_time_series['2000-11-04'] respectively extracts views of the time series my_time_series corresponding to the entire year 1995, the entire month May 1999, and the entire day November 4, 2000.
Instructions
100 XP
  • Extract a slice named view_1 from the series aapl containing data from November 2007 to April 2008 (inclusive). This has been done for you.
  • Plot the slice view_1 in 'red' in the top subplot of a vertically-stacked pair of subplots with the xticks rotated to 45 degrees.
  • Assign the slice view_2 to contain data from the series aapl for January 2008. This has been done for you.
  • Plot the slice view_2 in 'green' in the bottom subplot with the xticks rotated to 45 degrees.