Skip to content

Instantly share code, notes, and snippets.

@hschafer
Created June 16, 2020 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hschafer/d9c310477205ee14b532099890a345e2 to your computer and use it in GitHub Desktop.
Save hschafer/d9c310477205ee14b532099890a345e2 to your computer and use it in GitHub Desktop.
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