I have the following values:
grade_list = [[99 73 97 98] [98 71 70 99]]
student_ids = [521 597 624 100]
Each array in the grade_list represents a list of grades for each student (student #521 grades are 99, 98, student #597 grades are 73, 71, and so on..)
My goal is to return the student ID of the one with the highest average grade (should be 521 since the average is 98.5 which is the highest)
I have tried this:
def find_student_with_max_avg(grade_list, student_ids):
mean_grades = np.mean(grade_list, axis=1)
best_student_index = student_ids[mean_grades.argmax()]
return best_student_index
which returned 521, but I have tried to play with the grade_list and I see that even when I set this student grades to 0, it still return 521`.
not sure how to get the student ID of the best student, any idea?