From e013bef28a426221773381f7b92bb6c9216a171a Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Fri, 28 Oct 2022 22:38:48 -0400 Subject: fixes in regenWebAssign, pullout MaxScore and better table cleanup --- regenWebAssign.py | 12 +++++++++--- 1 file 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') -- cgit v1.2.3