I am trying to create a series of functions to extract data from certain sheets of x number of excel documents into one data frame.
What I have so far is:
import os
import glob
os.chdir(r'path')
FileList = glob.glob('*.xlsm')
print(FileList)
for file in FileList:
df = extract_account(file, '2016')
df = df.dropna()
df_combined = pd.concat([df])
However, when I call df_combined it is returning only one df (I am expecting a minimum of 5 in my test). extract_account(file_name, sheet_name) is a function I have created which extracts the data I want for one file and it returns a pandas.core.frame.DataFrame object. My next step would then be to pass this function a list of years to extract from.