Pandas DataFrames are two-dimensional data structures with labeled rows and columns, that can hold many data types. If you are familiar with Excel, you can think of Pandas DataFrames as being similar to a spreadsheet. We can create Pandas DataFrames manually or by loading data from a file. In this lesson, we will start by learning how to create Pandas DataFrames manually from dictionaries, and later we will see how we can load data into a DataFrame from a data file.
Create a DataFrame manually
We will start by creating a DataFrame manually from a dictionary of Pandas Series. It is a two-step process:
The first step is to create the dictionary of Pandas Series.
After the dictionary is created we can then pass the dictionary to the pd.DataFrame() function.