Reputation: 33
I would like to print my nested dictionary into a tabular format which would somehow look like this:
**ID** **Count** **Time** **OutCount** **OutTime**
262 725 15:29 725 15:29
and so on .....
My nested dictionary is:
{'262': {'count': 725,'time': '15:29','outcount': 725,'outtime': '15:29'},
'343': {'count': 699,'time': '15:29','outcount': 699,'outtime': '15:29'},
'809': {'count': 695,'time': '15:29','outcount': 695,'outtime': '15:29'}
Upvotes: 2
Views: 86
Reputation: 7693
pd.DataFrame.from_dict(d, orient='index')
count time outcount outtime
262 725 15:29 725 15:29
343 699 15:29 699 15:29
809 695 15:29 695 15:29
or with reset_index
pd.DataFrame.from_dict(d, orient='index').reset_index()
index count time outcount outtime
0 262 725 15:29 725 15:29
1 343 699 15:29 699 15:29
2 809 695 15:29 695 15:29
Upvotes: 5