问题
I have an excel file with about 20 sheets. Each sheets contain different type of data I would like to loop the excel and create a data frame for each of these sheets with data frame name equal to the sheet name.
Tried different solution without success
回答1:
You can create dictionary of DataFrames by parameter sheet_name=None in read_excel:
dfs = pd.read_excel(fileName, sheet_name=None)
print (dfs['sheetname1'])
print (dfs['sheetname2'])
来源:https://stackoverflow.com/questions/52538718/pandas-create-separate-dataframe-for-each-excel-sheet