Question: Problem 2 Your second and final task is to write a function called Assign _ Grades, which has the following two inputs: df _ grades

Problem 2
Your second and final task is to write a function called "Assign_Grades", which has the following two inputs:
df_grades_w_final_perc: This is the df_grades dataframe with the Final_Perc column added to it. In other words, you may assume that df_grades_w_final_perc has a column called Final_perc which is each student's final percentage.
cutoffs: This is a list that always has 4 entries. The first entry is the minimum score needed for an "A", the second entry is the minumum score needed for a "B", the third entry is the minumum score needed for a "C" and the last entry is the miminum score needed for a "D". Any score below this fourth entry is awarded an "F". You may assume that all cutoffs are unique so you don't have to worry about ties. Finally, you may assume that the cutoffs for better grades are always higher than the cutoffs for lower grades.
Your goal is to add to df_grades_w_final_perc a column called "letter", which contains each student's letter grade (as a string, i.e., an A should added as "A") according to the inputted cutoff points.
Hint: The pandas method "cut" could be very helpful here.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!