Visualizing seasonal patterns
As we will learn in Chapter XXX, seasonality plays a very important role in time series analysis. By seasonality, we mean the presence of patterns that occur at regular intervals (shorter than a year). For example, imagine the sales of ice creams, which most likely experience a peak in the summer months, while the sales decrease in winter. And such patterns can be seen year over year. We show how to use the line plot with a slight twist to efficiently investigate such patterns.
In this recipe, we will visually investigate seasonal patterns in the US unemployment rate from the years 2014-2019.
How to do it…
Execute the following steps to create a line plot showing seasonal patterns.
- Import the libraries and authenticate:
import pandas as pd
import quandl
import seaborn as sns
quandl.ApiConfig.api_key = "YOUR_KEY_HERE"
- Download and display unemployment data from Quandl:
df = (
quandl.get(dataset=" FRED/UNRATENSA",
...