Session Ready
Exercise

Identify Extreme Values

Now that you have created a data frame with the percentage of Hispanic racial self-identification by state, you will explore it further, beginning by creating a boxplot using seaborn.

You will also find the states with the largest or smallest percentage of Hispanics identifying as particular races. To do so, you will apply the squeeze() method. This method converts a single-row data frame to a series (with no effect on a data frame with more than one row).

pandas has been imported. The data frame states_hr is loaded, which has percentages of racial self-identification for 7 different race categories.

Instructions
100 XP
  • Create a boxplot by setting the data parameter to the name of the data frame. (orient = "h" will plot the boxplots horizontally.)
  • Using squeeze, show the state with the largest value in column hispanic_white.
  • Using squeeze, show the state with the smallest value in column hispanic_other.
  • Notice that very few Hispanics identify as Asian, but one state is a high outlier. Using squeeze, show the state with the largest value in column hispanic_asian.