Created
June 16, 2020 00:29
-
-
Save hschafer/d9c310477205ee14b532099890a345e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SID_COL = 0 | |
SCORE_COL = 8 | |
GRADE_COL = 9 | |
grades_by_sid = grades.set_index('SIS Login ID') | |
gradebook = pd.read_excel('gradebook.xls', header=None) | |
for i, row in gradebook.iterrows(): | |
sid = row[SID_COL] | |
if sid in grades_by_sid.index: | |
row[SCORE_COL] = grades_by_sid.loc[sid, 'Final Score'] | |
row[GRADE_COL] = str(grades_by_sid.loc[sid, 'FinalGrade']) | |
display(gradebook.head()) | |
gradebook.to_excel('gradebook_export.xls', header=False, index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment