Here is the for loop using which I am writing my data frame in excel sheet
for i in range(1,len(sorted_tasks[sorted_tasks.columns[0]])):
ls = list(sorted_tasks.loc[i])
if sorted_tasks['Age'][i]>=10 and type_of_breach(sorted_tasks['Expected Delivery Date'][i]) != 'y':
worksheet.write_row(i,0,ls,format_green)
elif type_of_breach(sorted_tasks['Expected Delivery Date'][i])=='y' and sorted_tasks['Age'][i]>=10:
worksheet.write_row(i,0,ls,format_orange)
elif type_of_breach(sorted_tasks['Expected Delivery Date'][i])=='y':
worksheet.write_row(i,0,ls,format_yellow)
elif type_of_breach(sorted_tasks['Expected Delivery Date'][i])=='r':
worksheet.write_row(i,0,ls,format_red)
else:
worksheet.write_row(i,0,ls,format_normal)
This is how I am getting it though the calculation are correct I want this to be in this format