1data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
2pd.DataFrame.from_dict(data)
1>>> data = {'row_1': [3, 2, 1, 0], 'row_2': ['a', 'b', 'c', 'd']}
2>>> pd.DataFrame.from_dict(data, orient='index')
3 0 1 2 3
4row_1 3 2 1 0
5row_2 a b c d
6
1>>> data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
2>>> pd.DataFrame.from_dict(data)
3 col_1 col_2
40 3 a
51 2 b
62 1 c
73 0 d
8
1#Lazy way to convert json dict to df
2
3pd.DataFrame.from_dict(data, orient='index').T
1In [11]: pd.DataFrame(d.items()) # or list(d.items()) in python 3
2Out[11]:
3 0 1
40 2012-07-02 392
51 2012-07-06 392
62 2012-06-29 391
73 2012-06-28 391
8...
9
10In [12]: pd.DataFrame(d.items(), columns=['Date', 'DateValue'])
11Out[12]:
12 Date DateValue
130 2012-07-02 392
141 2012-07-06 392
152 2012-06-29 391
16
1>>> pd.DataFrame.from_dict(data, orient='index',
2... columns=['A', 'B', 'C', 'D'])
3 A B C D
4row_1 3 2 1 0
5row_2 a b c d
6