我在不同文件上运行脚本。这些文件是用相同的方式生成的,因此这些文件绝不会有问题。但是,我的代码在某些文件上运行,并在其他文件上出错。
DFs=[]
list_dfs=[]
for f in filenames:
Data = pd.read_csv(f,index_col=None, header=0)
df=Data.iloc[:, 0:19] ## step 1
(OTHER LINES)
DFs.append(daf)
**daf.iloc[-1]=["","",merge_Delay,count,"","","","","","","","","","","","",spacing,"",""]**
daf.index = daf.index -1
dfs = pd.concat(DFs,axis=0)
dfs.to_csv('{}_conv.csv'.format(f, index = False))
该错误位于突出显示的行中,它给了我 单个位置索引器超出范围