Equality Of OddsCode with Python
An audit starts with the rates, group by group. This plain-Python program counts how many qualified and not-qualified applicants are at or above each school's threshold; rates returns the pair (TPR, FPR). Run it, then try other thresholds. Can you make both of the last lines print True?
One Confusion Matrix per School
scikit-learn's confusion_matrix counts all four outcomes at once, and .ravel() flattens the 2 × 2 matrix into the four numbers TN, FP, FN and TP, in that order. The key step of any fairness audit is the loop: one matrix per group, never just one for everybody. Run it, then change a threshold.