Merging Spreadsheets with Python–Append

Three spreadsheets are appended into one based on column names
Two spreadsheets are joined into one based on the same Name values

Disclaimer

Pre-requisite

Files

Full Code

Full Code for this tutorial

I. Read all three spreadsheets

import pandas as pd
marketing_analyst_names = pd.read_excel("MarketingAnalystNames.xlsx")sales_rep_names = pd.read_excel("SalesRepNames.xlsx")senior_leadership_names =   pd.read_excel("SeniorLeadershipNames.xlsx")

II. Merge all three data frames

all_df_list = [marketing_analyst_names, sales_rep_names, senior_leadership_names]
appended_df = pd.concat(all_df_list)

III. Write to an Excel file

appended_df.to_excel("AllCompanyNames.xlsx", index=False)
$ python append.py

--

--

Supercharge your spreadsheets. Check us out at www.lovespreadsheets.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store