ahunter1289 / pyiotools

tools for science, engineering, mathematics, data analysis, and more
0 stars 0 forks source link

data_by #19

Closed ahunter1289 closed 1 year ago

ahunter1289 commented 1 year ago

was

for i in range(len(head_search_val)):
    found=0
    for k in range(len(data)):
        if len(data[k])<2:
            continue
        if head_search_val[i]==data[k][0]:
            head_results.append(data[k][1:return_cols+1])
            found=1
        if k==len(data)-1 and found==0:
            raise Exception('Could not find: ' + head_search_val[i])

is

for i in range(len(head_search_val)):
    found=0
    for k in range(len(data)):
        if k==len(data)-1 and found==0:
            #raise Exception('Could not find: ' + head_search_val[i])
            warnings.warn('Could not find: ' + head_search_val[i])
            head_results.append(['header not found'])
        if len(data[k])<2:
            continue
        if head_search_val[i]==data[k][0]:
            head_results.append(data[k][1:return_cols+1])
            found=1