Plot all the time series in your dataset
The jobs
DataFrame contains 16 time series representing the unemployment rate of various industries between 2001 and 2010. This may seem like a large amount of time series to visualize at the same time, but Chapter 4 introduced you to facetted plots. In this exercise, you will explore some of the time series in the jobs
DataFrame and look to extract some meaningful information from these plots.
This exercise is part of the course
Visualizing Time Series Data in Python
Exercise instructions
- Review the first 5 rows of
jobs_subset
. - Create a faceted plot of the new
jobs_subset
DataFrame using a layout of 2 rows and 2 columns. Make sure to also specify that the subgraphs do not share x-axis and y-axis values.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# A subset of the jobs DataFrame
jobs_subset = jobs[['Finance', 'Information', 'Manufacturing', 'Construction']]
# Print the first 5 rows of jobs_subset
print(____)
# Create a facetted graph with 2 rows and 2 columns
ax = ____(subplots=____,
layout=____,
sharex=____,
sharey=____,
linewidth=0.7,
fontsize=3,
legend=False)
plt.show()