Browse Source

s8 header bug fix

master
sipp11 11 years ago
parent
commit
195f391598
  1. 3
      s7.py
  2. 23
      s8.py

3
s7.py

@ -17,7 +17,7 @@ No of R ของคณ ======= TOTAL -- ถาตองการท
แต ผมไมบรองวาจะใชไดงหมดเพราะว นกนกบหลายอยาง
เช 1Ts ไมนอาจจะ error ? โดยเฉพาะเวลา random
'''
NOT_ARG = '3Ts'
NOT_ARG = 'all'
TOTAL = 20
SRC_PATH = os.path.join(TARGET_DIR, 'part6')
@ -32,6 +32,7 @@ def get_yynn_count(cols):
n += 2
return n
def get_by_order():
for m in MODEL_LIST:
result = []

23
s8.py

@ -73,20 +73,31 @@ def middleman(ls, rs):
def main():
header = [
'lo_id', '',
] + ['' for i in xrange(0, 19)]
header = ['LO_xxx', '____', ]
for m in MODEL_LIST:
l_list, lo_data = get_test_data(m)
m_header = header[:]
m_header[1] = m
for i in '1234':
m_header = header[:]
m_header[1] = m
ros = get_ro_data(m, i)
for r in ros:
m_header.append(r[0])
result = middleman(lo_data, ros)
output_name = '%s-%s.csv' % (m, i)
result = [m_header] + result
# process header -- get ind of first R_xxx
number_ind = 0
cnt_ind = 0
for i in result[0]:
try:
float(i)
number_ind = cnt_ind
cnt_ind = 0
break
except ValueError:
cnt_ind += 1
__h = m_header[:2] + ['_' for i in xrange(0, number_ind-2)] + m_header[3:]
result = [__h] + result
create_csv(output_name, result, directory='part8')
main()

Loading…
Cancel
Save