I have a dict with 11 items in it, here\'s a scree shot from Spyder variable explorer:
def buildDF(result_set):
master_dm = []
for p in result_s
When iterating over the dictionary try calling the dict.items()
method:
sessions1 = {10000:'val1',100000:'val2',2000:'val3',3000:'val4',4000:'val5',5000:'val6',6000:'val7',7000:'val8',8000:'val9',9000:'val10',10000:'val11'}
def buildDF(result_set):
master_dm = []
for k,v in result_set.items():
master_dm.append(v)
return(master_dm)
sessions1DF = buildDF(sessions1)
print(sessions1DF)
# ['val11', 'val2', 'val6', 'val5', 'val3', 'val8', 'val4', 'val9', 'val7', 'val10']