Joining Excel Data from Multiple files using Python Pandas Last Updated : 17 Aug, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Let us see how to join the data of two excel files and save the merged data as a new Excel file. We have 2 files, registration details.xlsx and exam results.xlsx. registration details.xlsx We are having 7 columns in this file with 14 unique students details. Column names are as follows : Admission Date Name of Student Gender DOB Student email Id Enquiry No. Registration No. exam results.xlsx We are having 7 columns in this file with 32 unique students' details. Column names are as follows : Registration No. Name No.of questions attempted Correct Incorrect Marks Obtained Percentage You can download these files from these links : registration details.xlsx and exam results.xlsx. Now, let's see the common columns between these two files : So the common column between the excel files is REGISTRATION NO. So we need to merge these two files in such a way that the new excel file will only hold the required columns i.e. : Algorithm : Import the Pandas module. Read both the files using the read_excel() function. Combine them using the merge() function. Use the to_excel() function, to create the resultant file. python # importing the module import pandas # reading the files f1 = pandas.read_excel("registration details.xlsx") f2 = pandas.read_excel("exam results.xlsx") # merging the files f3 = f1[["REGISTRATION NO", "STUDENT EMAIL ID "]].merge(f2[["REGISTRATION NO", "Name", "Marks Obtained", "Percentage"]], on = "REGISTRATION NO", how = "left") # creating a new file f3.to_excel("Results.xlsx", index = False) Output : Comment More infoAdvertise with us Next Article Joining Excel Data from Multiple files using Python Pandas A amitkkumra Follow Improve Article Tags : Python Python-pandas Practice Tags : python Similar Reads How to create multiple CSV files from existing CSV file using Pandas ? In this article, we will learn how to create multiple CSV files from existing CSV file using Pandas. When we enter our code into production, we will need to deal with editing our data files. Due to the large size of the data file, we will encounter more problems, so we divided this file into some sm 3 min read Joining two Pandas DataFrames using merge() The merge() function is designed to merge two DataFrames based on one or more columns with matching values. The basic idea is to identify columns that contain common data between the DataFrames and use them to align rows. Let's understand the process of joining two pandas DataFrames using merge(), e 4 min read How to read multiple data files into Pandas? In this article, we are going to see how to read multiple data files into pandas, data files are of multiple types, here are a few ways to read multiple files by using the pandas package in python. The demonstrative files can be download from here Method 1: Reading CSV files If our data files are in 3 min read How to Merge Multiple Excel Files into a Single Files with Python We often deal with multiple Excel files that need to be combined into a single consolidated file. Manually merging them or using Excel macros can be slow and prone to errors. To make this process faster and more reliable, we will use Pythonâs pandas module to automate merging multiple Excel files in 3 min read How to Join Pandas DataFrames using Merge? Joining and merging DataFrames is that the core process to start  out with data analysis and machine learning tasks. It's one of the toolkits which each Data Analyst or Data Scientist should master because in most cases data comes from multiple sources and files. In this tutorial, you'll how to join 3 min read Like