ahunter1289 / pyiotools

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

SOLVE THIS #22

Closed ahunter1289 closed 1 year ago

ahunter1289 commented 1 year ago

The problem with remove the minus 1 below is that the first if statement will never be true because k will never equal the len(data).

was: 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  

is: for i in range(len(head_search_val)): found=0 for k in range(len(data)): if k==len(data) 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