VOOZH about

URL: https://www.geeksforgeeks.org/python/combining-dataframes-with-pandas/

⇱ Combining DataFrames with Pandas - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Combining DataFrames with Pandas

Last Updated : 23 Jul, 2025

Pandas DataFrame consists of three principal components, the data, rows, and columns. To combine these DataFrames, pandas provides multiple functions like concat() and append().

Method #1: Using concat() method

Initially, creating two datasets and converting them into dataframes. 

Output: 

👁 Image
👁 Image

Now, concatenating the two dataframes, we will use concat() to combine two dataframes. If ignore_index = True the index of df will be in a continuous order. 

Output:

👁 Image

Using keys we can specify the labels of the dataframes.

Output:

👁 Image

Method #2: Using append() method

Initially, creating two datasets and converting them into dataframes. 

Output: 

👁 Image
👁 Image

The dataframe.append() method performs the operation of combining two dataframes similar to that of the concat() method.

Output:

👁 Image

Comment