Pandas Convert list to DataFrame

In this tutorial, We will see different ways of Creating a pandas Dataframe from List.

You can use Dataframe() method of pandas library to convert list to DataFrame. so first we have to import pandas library into the python file using import statement.

So let’s see the various examples on creating a Dataframe with the list :

Example 1 : create a Dataframe by using list .

Output :

Example 2: Create a Dataframe by using list with index and column names.

Output :

Example 3 : create a Dataframe by list with using zip() function and column names.

Output :

Example 4: Create a Dataframe by using list of lists and column names.

Output :

Example 5: Create a Dataframe by using list as a value in dictionary.

Output :

That’s all about how to Create a Pandas Dataframe from List.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *