create pandas dataframe from dictionary

data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
pd.DataFrame.from_dict(data)

Here is what the above code is Doing:
1. We create a dictionary with two keys, ‘col_1’ and ‘col_2’.
2. We assign to each key a list of values.
3. We create a DataFrame by passing the dictionary to the DataFrame constructor.

Note that the keys of the dictionary become the column names, and the values in the lists become the row values.

You can also create a DataFrame from a list of lists (or a list of tuples). When you do this, the list of lists is assigned to the rows parameter. Take a look: