Compare labor market participation and unemployment rates
Two economic data series in FRED are the Civilian Unemployment Rate ('UNRATE'
) and the Civilian Labor Force Participation Rate ('CIVPART'
).
These rates highlight two important aspects of the US labor market: the share of the civilian population that is currently unemployed or seeking employment, and the share of those active in the labor market that are in fact employed.
This means that the numbers indicate both the size of the labor market relative to the total population, as well as the size of unemployment relative to the labor market.
Here, you will import, modify, and plot the data. DataReader
, date
, pandas
as pd
, and matplotlib.pyplot
as plt
have been imported.
This exercise is part of the course
Importing and Managing Financial Data in Python
Exercise instructions
- Using
date()
, setstart
to January 1, 1950. - Create
series
as a list containing the series codes'UNRATE'
and'CIVPART'
, in that order. - Pass
series
, the data source'fred'
, and the start date toDataReader()
, and assign the result toecon_data
. - Use the
.columns
attribute to assign'Unemployment Rate'
and'Participation Rate'
as the new column labels. - Plot and show
econ_data
using thesubplots=True
argument, and title it'Labor Market'
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Set the start date
start = ____
# Define the series codes
series = ['UNRATE', 'CIVPART']
# Import the data
econ_data = ____
# Assign new column labels
econ_data.columns = ____
# Plot econ_data
____
# Show the plot
plt.show()