Examples
The keys of the dict become the DataFrame columns by default:

In [1]:
import numpy as np
import pandas as pd
In [2]:
data = {'c_1': [4, 3, 2, 0], 'c_2': ['p', 'q', 'r', 's']}
pd.DataFrame.from_dict(data)
Out[2]:
c_1 c_2
0 4 p
1 3 q
2 2 r
3 0 s

Specify orient='index' to create the DataFrame using dictionary keys as rows:

In [3]:
data = {'row_1': [4, 3, 2, 0], 'row_2': ['p', 'q', 'r', 's']}
pd.DataFrame.from_dict(data, orient='index')
Out[3]:
0 1 2 3
row_1 4 3 2 0
row_2 p q r s

When using the ‘index’ orientation, the column names can be specified manually:

In [4]:
pd.DataFrame.from_dict(data, orient='index',
                       columns=['P', 'Q', 'R', 'S'])
Out[4]:
P Q R S
row_1 4 3 2 0
row_2 p q r s