You may be best off writing your own function to address the problem. The below example is not a complete solution, but how i would approach the problem and might be a good starting space for you too.
Lets imagine that you are sorting students numerical grades into A, B, C, D, E...
and you have a classList of lists [[studentName, numGrade]]
For eachStudent in classList:
if numGrade >= 90
classList[x].append = "A"
if numGrade <= 90 and >= 80
classList[x].append = "B"
....
At the end of of it you should be able to create a list of lists, that has categorized the letter grade of the student to the numerical grade they have earned.