ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Importing and Managing Financial Data in Python

Ver curso

Instrucciones del ejercicio

  • Using date(), set start 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 to DataReader(), and assign the result to econ_data.
  • Use the .columns attribute to assign 'Unemployment Rate' and 'Participation Rate' as the new column labels.
  • Plot and show econ_data using the subplots=True argument, and title it 'Labor Market'.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# 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()
Editar y ejecutar código