Setup: I am using jupyter notebook, Python version 3.6.2, and Excel version 15.36
I have several excel files (each file with multiple sheets). I have loaded each excel file (code below) so that a dataframe that is an ordered dict of the sheets in the file is created for each excel file.
import pandas as pd
df1 = pd.read_excel('2014.xlsx', sheetname=None, header=1)
df2 = pd.read_excel('2015.xlsx', sheetname=None, header=1)
..etc..
Now I want to loop through each sheet of each file, add a new cell to each row of the sheet that contains the sheet name, and then merge all the sheets of all the files together into one large sheet.
I am new to python and would love to hear a clean way to execute this task.
sheetname=Nonewill read the first sheet and return a dataframe. - Paul H