Now let's look at applying Categoricals to help us organize information based on categories instead of numbers. The problem we will examine is assigning a letter grade to a student based on their numeric grade.
This data frame represents the raw score for each of the students. Next, we break down numeric grades into letter codes. The following code defines the bins for each grade and the associated letter grade for each bin:
Using these values, we can perform a cut that assigns the letter grade.
Examining the underlying ...