Let's say that I have something like the following:
target = "path_to_excel.xlsx"
raw_data = pandas.ExcelFile(target)
Then if I use the method:
raw_data.sheet_names
I will get a list of the sheet names contained within that spreadsheet. My question is how would I create a variable number of data frames based upon the number of sheets? IE:
In [1] len(raw_data.sheet_names)
Out [1] 3
list_of_df_names = []
for x in range(len(raw_data.sheet_names)):
list_of_df_names.append("df"+str(x))
for i, element in enumerate(list_of_df_names):
element = pandas.read_excel(raw_data, raw_data.sheet.names[i])