Create dataframe from dict
Tags: #pandas #dict #snippet #dataframe
Author: Florent Ravenel
Here below you will find how to create a pandas DataFrame from a simple dict

Input

Import libraries

1
import pandas as pd
Copied!

Setup your dict

1
my_dict = {"LABEL": 1995, "VALUE": 219}
Copied!

Model

Create dataframe

1
df = pd.DataFrame([my_dict])
2
df
Copied!

Output

Display result

1
df
Copied!
Copy link
Edit on GitHub