diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-10-28 22:38:48 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-10-28 23:03:00 -0400 |
commit | e013bef28a426221773381f7b92bb6c9216a171a (patch) | |
tree | 85fe9e8107bb6597d0663e1feaa60bb105051a0a /regenWebAssign.py | |
parent | d74629ad83fd9374c0cf650c65d0d702cfb6d516 (diff) | |
download | GradeBook-e013bef28a426221773381f7b92bb6c9216a171a.tar.gz GradeBook-e013bef28a426221773381f7b92bb6c9216a171a.zip |
fixes in regenWebAssign, pullout MaxScore and better table cleanup
Diffstat (limited to 'regenWebAssign.py')
-rwxr-xr-x | regenWebAssign.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/regenWebAssign.py b/regenWebAssign.py index 788ecb8..ca6ffd4 100755 --- a/regenWebAssign.py +++ b/regenWebAssign.py @@ -24,13 +24,19 @@ headers[2]='SID' headers[3]='TotalPcnt' headers[4]='TotalScore' -d = pd.read_csv(infile, skiprows=9, header=None, names=headers) +d = pd.read_csv(infile, skiprows=[0,1,2,3,4,5,7,8], header=None, names=headers) +d.loc[0, 'FullName']='MaxScore' +d.loc[0, 'UserName']='MaxScore' + # cleanup -index = d[:][5:] == 'ND' +c = d.columns +c=c.drop(['FullName', 'UserName', 'SID']) +index = d[c] == 'ND' d[index] = np.nan -index = d[:][5:] == 'NS' +index = d[c] == 'NS' d[index] = np.nan d['UserName'].replace('@wm$', '', regex=True, inplace=True) +d['UserName'].replace('@email.wm.edu$', '@wm.edu', regex=True, inplace=True) d.to_csv('WebAssign.csv') |