VOOZH about

URL: https://www.geeksforgeeks.org/python/creating-a-pandas-dataframe-using-list-of-tuples/

⇱ Creating a Pandas dataframe using list of tuples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Creating a Pandas dataframe using list of tuples

Last Updated : 11 Jul, 2025

A Pandas DataFrame is an important data structure used for organizing and analyzing data in Python. Converting a list of tuples into a DataFrame makes it easier to work with data. In this article we'll see ways to create a DataFrame from a list of tuples.

1. Using pd.DataFrame()

The simplest method to create a DataFrame is by using the pd.DataFrame() function. We pass list of tuples along with column names. We will be using the Pandas library for its implementation.

Output:

👁 DF1
Using pd.DataFrame()

2. Using from_records()

Another method to create a DataFrame is using the df.from_records() method. This method is useful when dealing with structured data.

Output:

👁 DF2
Using from_records()

3. Using pivot()

In some cases we may want to reorganize our DataFrame into a pivot table. We can do this by using the pivot() function. This will help us to change the layout of the DataFrame.

Output:

👁 DF3
Using pivot()

As we continue working with Pandas these methods will help in the strong foundation for efficiently handling and analyzing data in future projects.

Comment