I am trying to write from Python into an Excel workbook using XlsxWriter.
I have a dictionary called Pg
whose keys are tuples.
for key,value in Pg.iteritems():
for t in range(1,4):
if key==(0,t):
worksheet.write(row,col,value.x)
row += 1
I want to write values of key (0,t) in a column, but the values don't appear in normal order. For example, if my dictionary looks like this:
Pg={(0,1):1,(0,2):2,(0,3):3}
I get in Excel:
1
3
2
Why is this happening when I have strictly determined in the second for
loop how I want my values to be written?