Python KeyError 10

时间:2019-07-02 12:02:24

标签: python keyerror

    import pandas as pd
    inputfile = pd.read_csv('inputfile.csv')
    output_file=inputfile.sort_values('time')
    df = pd.DataFrame(output_file)
    df.to_csv("Outputfile.csv",index=False)
    new_file = pd.read_csv('Outputfile.csv')
    j=1
    i=0
    for k in new_file.Application:
        if new_file.time[i]+new_file.time[j] >= 3.0 and ` 
           new_file.time[i]+new_file.time[j] <= 5:

    new_val = new_file.time[i]+new_file.time[j]
    print(new_file.Application[i], ` 
          ",",new_file.Application[j],"=",new_val)
    i += 2
    j +=2
 print(new_file.Application[i], "=", new_file.time[i])
  i +=1

我在这里遇到错误i += 1

0 个答案:

没有答案