I have
data_dict = {1: {'One': 110, 'Two': 210, 'three': 310},
2: {'One': 120, 'Two': 220, 'three': 320},
3: {'One': 130, 'Two': 230, 'three': 330}}
need to print as CSV in this order
'',1,2,3
One,110,120,130
Two,210,220,230
Three,310,320,330
No idea how to do it spent hours trying totally exhausted. I need pure python solution without using Numpy Transpose, Itertools etc
There are numerous ways to do this. The simplest is probably to create an intermediate dictionary.
Something like this:
Output: