File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11import pandas as pd
22
33NUM_CLASSES = 7
4- TOP_SCORE = NUM_CLASSES
54FREEBIES = 1
5+ TOP_SCORE = NUM_CLASSES - FREEBIES
66
77ROLL_CALL_CSV = (
88 "~/Downloads/attendance_reports_attendance-264e4d14-1765-4396-b311-4d927b59566d.csv"
@@ -70,11 +70,10 @@ def compute_scores(entries: pd.DataFrame):
7070 # print_heading("Attendance counts")
7171 # print_students(attendance_counts)
7272
73- # factor in the freebies
74- scores = attendance_counts + FREEBIES
75- scores [scores > TOP_SCORE ] = TOP_SCORE
73+ # cap the top scores
74+ attendance_counts [attendance_counts > TOP_SCORE ] = TOP_SCORE
7675
77- return scores
76+ return attendance_counts
7877
7978
8079def write_canvas_csv (scores : pd .Series ):
@@ -108,7 +107,7 @@ def run():
108107 print_students (scores )
109108
110109 lowered_scores = scores [scores < TOP_SCORE ]
111- print_heading (f"Scores for students who missed more than { FREEBIES } class(es) " )
110+ print_heading (f"Scores below { TOP_SCORE } " )
112111 print_students (lowered_scores .sort_values ())
113112
114113 write_canvas_csv (scores )
You can’t perform that action at this time.
0 commit comments