I apologized as I am very new to python. I am iterating through out several name and they all getting the same dictionary key and value. How can i just print the key once and keep appending the value as per iteration to a csv?
for name in namelist:
print >> out,','.join(data.keys())
print >> out,','.join(data.values())
fundamental_out.close()
the output looks like this
>>'key1,key2,key3'
>>'value1,value2,value3'
>>'key1,key2,key3'
>>'value1,value2,value3'
say key3 is the Name, key1 and 2 are numeric
how can i get an output like
>>'key1,key2,key3'
>>'value1,value2,value3'
>>'value1,value2,value3'
also is there a way to sort data dictionary in an order so that key3 (i.e. name will be the first column) ?
>>'key3,key1,key2'
>>'value3,value1,value2'
>>'value3,value1,value2'
THANKS!