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
Your second and final task is to write a function called "AssignGrades", which has the following two inputs:
dfgradeswfinalperc: This is the dfgrades dataframe with the FinalPerc column added to it In other words, you may assume that dfgradeswfinalperc has a column called Finalperc which is each student's final percentage.
cutoffs: This is a list that always has 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 dfgradeswfinalperc a column called "letter", which contains each student's letter grade as a string, ie 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
