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
We are having 7 columns in this file with 14 unique students details. Column names are as follows :
- Admission Date
- Name of Student
- Student email Id
- Enquiry No.
- Registration No.
We are having 7 columns in this file with 32 unique students’ details. Column names are as follows :
- Registration No.
- No.of questions attempted
- Marks Obtained
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. :
- Import the Pandas module.
- Read both the files using the
- Combine them using the
- Use the
to_excel()function, to create the resultant file.
- How to Filter and save the data as new files in Excel with Python Pandas?
- Tableau - Joining data files with inconsistent labels
- Working with excel files using Pandas
- How to Create a Pivot table with multiple indexes from an excel sheet using Pandas in Python?
- Creating a dataframe using Excel files
- Combine Multiple Excel Worksheets Into a Single Pandas Dataframe
- How to extract Time data from an Excel file column using Pandas?
- Joining two Pandas DataFrames using merge()
- Python | Write multiple files data to master file
- Rename multiple files using Python
- Convert CSV to Excel using Pandas in Python
- How to import an excel file into Python using Pandas?
- Find the profit and loss in the given Excel sheet using Pandas
- How to sort date in excel using Pandas?
- How to extract Email column from Excel file and find out the type of mail using Pandas?
- How to import excel file and find a specific column using Pandas?
- How to extract date from Excel file using Pandas?
- Find the profit and loss percent in the given Excel sheet using Pandas
- Find the sum and maximum value of the two column in excel file using Pandas
- Python | Plotting column charts in excel sheet with data tables using XlsxWriter module
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.