在这段代码中,我尝试读取csv文件并查找总通过次数和失败次数,并且不得不将第二个for循环段插入到csv文件中。
d=dfs[i]['Filename'].tolist()
total=len(dfs[i].IngestionStatus)
tpass=len(dfs[i][dfs[i]['IngestionStatus'] == 'Pass'])
tfail=total-tpass
print ("SNo\t\tName\t\tTotal\t\tTotalPass\t\tTotalFail")
print ("------------------------------------------------------------------------------------")
for j in range(1):
print ("%d:\t\t%s\t\t%d\t\t%d\t\t\t%d" % (j,d[j] ,total,tpass,tfail))
print ("------------------------------------------------------------------------------------")```
Need to convert this section of the code into a table and insert it into a csv file