|
|
|
@ -14,6 +14,17 @@ xmodels = {
|
|
|
|
|
'CFSf': {}, 'CFSD': {}, 'CFHf': {}, 'CFHD': {}, 'PMSf': {}, 'PMSD': {}, |
|
|
|
|
'PMHf': {}, 'PMHD': {}, 'PFSf': {}, 'PFSD': {}, 'PFHf': {}, 'PFHD': {}, |
|
|
|
|
} |
|
|
|
|
rk_conv = { |
|
|
|
|
'I': ['4', '3', '2', ''], |
|
|
|
|
'P': ['4', '3', '2', ''], |
|
|
|
|
'C': ['4', '3', '2', ''], |
|
|
|
|
'F': ['5', '4', '3', '2', ''], |
|
|
|
|
'M': ['5', '4', '3', '2', ''], |
|
|
|
|
'H': ['4', '3', '2', ''], |
|
|
|
|
'S': ['4', '3', '2', ''], |
|
|
|
|
'f': ['4', '3', '2', ''], |
|
|
|
|
'D': ['4', '3', '2', ''], |
|
|
|
|
} |
|
|
|
|
fs = ('Case1_LS.csv', 'Case1_Gender.csv', 'Case1_Level.csv', 'Case1_SciF.csv') |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -60,7 +71,7 @@ def produce_s2_part1(sum_result):
|
|
|
|
|
create_csv(_f, rows, directory='part2') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def produce_s2_part2(rank_result): |
|
|
|
|
def produce_s2_part2_old(rank_result): |
|
|
|
|
# create xxxx-2.csv |
|
|
|
|
for ii in xmodels.keys(): |
|
|
|
|
rows = [] |
|
|
|
@ -87,6 +98,23 @@ def produce_s2_part2(rank_result):
|
|
|
|
|
create_csv(_f, rows, directory='part2') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def produce_s2_part2(rank_result): |
|
|
|
|
# create xxxx-2.csv |
|
|
|
|
for ii in xmodels.keys(): |
|
|
|
|
rows = [] |
|
|
|
|
for rk in xrange(0, 4): |
|
|
|
|
rank_no = rk + 1 |
|
|
|
|
# print(ii, ':rank:', rank_no) |
|
|
|
|
rows.append(['Rank#%s' % rank_no, 'rank', rank_no]) |
|
|
|
|
for i in ii: |
|
|
|
|
if not rk_conv[i][rk]: |
|
|
|
|
continue |
|
|
|
|
# print(i, '::', rk_conv[i][rk]) |
|
|
|
|
rows.append([i, ','.join(rank_result[i][rk_conv[i][rk]])]) |
|
|
|
|
_f = '%s-2.csv' % ii |
|
|
|
|
create_csv(_f, rows, directory='part2') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def process_lo_weight(): |
|
|
|
|
los = {} |
|
|
|
|
for i in fs: |
|
|
|
|