Merge Excel Spreadsheet with same columns

From rbachwiki
Revision as of 16:25, 2 September 2020 by Bacchas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Merge two spreadsheets

Merge two or more spreets from different files with similar columns, but choose which columns you want to include in the merge

import pandas as pd
file1 = 'wall1.xlsx'
file2 = 'wall2.xlsx'

wall1 = pd.read_excel(file1)
wall2 = pd.read_excel(file2)

values1 = wall1[['SKU','ProductType','SA3']]
values2 = wall2[['SKU','ProductType','SA3']]

dataframes = [values1, values2]
join = pd.concat(dataframes)
join.to_excel("output.xlsx")

Back To Top - Main Category/ Excel Category