I'm trying to make a loop where new values are put into a new row in the same excel sheet. I've succefully made a loop where for every new ''sampleid'' it made a new sheet but now I want for every new ''sampleid'' to do a new row with the values. This is the code im currently using, how can I modify it for the results I want?
if sampleid!="000":
print sampleid
print "Isotope \t", "A (Bq/kg) +/- 1 sd \t MDA (Bq/kg)"
#sampleid = workbook.add_worksheet()
if create_an_excel_file_with_one_table:
worksheet = workbook.add_worksheet(sampleid)
worksheet.set_column('A:AA', 30)
for i in range(len(activity)):
if isotopes[i]=="Pb-210" :
worksheet.write(i+2, 0, isotopes[i])
worksheet.write(i+2, 1,str(np.round(activity_pbc[i]/mass,8)))
worksheet.write(i+2, 2, '+/-')
worksheet.write(i+2, 3,str(np.round(sigma_activity_pbc[i]/mass,8)))
worksheet.write(i+2, 4,str(MDA[i]/mass))
worksheet.write("B1", sampleid, bold)
worksheet.write("A1", "Sampleid:", bold)
worksheet.write("A2", "Isotope", bold)
worksheet.write("B2","Activity (Bq/kg)", bold)
worksheet.write("C2",'+/-', bold)
worksheet.write("D2",'1 sd', bold)
worksheet.write("E2","MDA (Bq/kg)", bold)
worksheet.write(row,3,'Detector:', bold)
worksheet.write(row,4,detector)
worksheet.set_default_row(hide_unused_rows=True)
workbook.close()