Session Ready
Exercise

Labor Force Participation

Unemployment could be going down because labor force participation is decreasing, that is, fewer people are looking for work! In this exercise, you will investigate that possiblity. You will start with a data frame, lf_by_race, of percent labor force participation by year for 25 to 54 year olds in four racial groups (White, Black, Asian, and Hispanic) and both sexes. You will create a bar plot of labor force participation against year. In order to condition the bar plot by demographic group, you will first melt the data frame. The data frame already has suitable column names.

pandas and seaborn have been imported with the usual aliases. unemp_by_race is loaded and five columns are displayed in the console.

Instructions
100 XP
  • melt the lf_by_race data frame, setting var_name to "demographic" and value_name to "labor_force_participation"; can you determine the appropriate column for the id_vars parameter?
  • Call sns.barplot with the year on the x-axis and labor force participation on the y-axis; then use the hue parameter to show sex grouped by year.