for indexs in df.index: rowData = df.loc[indexs].values[0:7] rowData = rowData.tolist() #print(rowData) sheet1.append(rowData) #逐行写入excel的sheet1