Published on
· Data Independent

Pandas DataFrame From Dict | pd.DataFrame.from dict()

This post is auto-generated from a public YouTube video for personal study notes. It is not an endorsement. The transcript is machine-derived and may contain errors; refer to the original video for accuracy.

About this video

You can create a DataFrame many different ways. One popular way to do it is creating a pandas DataFrame from dict, or from a dictionary.

There are two main ways to create a DataFrame from a dictionary, using orient=columns or orient=index. Orient is short for orientation, or, a way to specify how your data is laid out.

Method 1 - Orient (default): columns = If you want the keys of your dictionary to be the DataFrame column names Method 2 - Orient: index = If the keys of your dictionary should be the index values.

You'll need to be explicit about column names.

Loading transcript…