Append Dataframe Pandas without Column Names

Appending is vertically stacking one Dataframe below the other. Appending can be easy if the Dataframes are well structured and has all column names present. In case column name is not present then appending Dataframes can be challenging. It is important to ensure that the Dataframes has all columns in same order as in other Dataframe, in case column names are not present. This article discusses step by step guide to Append Dataframe Pandas without Column Names.

John has 2 month of transaction data without Header available. The two Dataframes does not contain any header. There are six fields available in each of the files. The format of the files are similar in both of them. He is looking forward to append them together to create single Panda Dataframe.

Append Dataframe Pandas without Column Names
Append Dataframe Pandas without Column Names

Below are the key steps to append two Dataframes together.

  • Step 1: Import all the necessary modules in Python.
import pandas as pd
  • Step 2: Use append function in Pandas to append files together. The second file can be added in the paranthesis. Please see the code below.
Trx_Data_2Months=Trx_Data_Jun20.append([Trx_Data_Jul20])
  • Step 3: Check the ouput data quality. As the two files has 100 rows each, hence the output file shall have 200 rows.
Trx_Data_2Months.head(10)
Print Shape of the file, i.e. number of rows and number of columns
 Trx_Data_2Months.shape
Append Dataframe Pandas without Column Names

Thus, Amy is able to create single Dataframe as per her requirement in Python.

To get top certifications in Python and build your resume visit here. Also, you can read books listed here to build strong knowledge around Python.

Visit us below for video tutorial:

 Looking to practice more with this example? Drop us a note, we will email you the Code file: 

    📬 Stay Ahead in Data Science & AI – Subscribe to Newsletter!

    • 🎯 Interview Series: Curated questions and answers for freshers and experienced candidates.
    • 📊 Data Science for All: Simplified articles on key concepts, accessible to all levels.
    • 🤖 Generative AI for All: Easy explanations on Generative AI trends transforming industries.

    💡 Why Subscribe? Gain expert insights, stay ahead of trends, and prepare with confidence for your next interview.

    👉 Subscribe here:

    Related Posts