Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python transpose dictionary

$
0
0

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,3One,110,120,130Two,210,220,230Three,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


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>