Home > front end >  I want to read Multiple sheets in excel into multiple dataframes in python
I want to read Multiple sheets in excel into multiple dataframes in python

Time:09-21

An excel file has multiple sheets, i want to read those sheets into multiple pandas dataframe. Is there a way to do it? Please Let Me know.

CodePudding user response:

xls = pd.ExcelFile('path_to_file.xls') 
sheets_names = ['Sheet1', 'Sheet2']
dfs = []
for sheet_name in sheets_names: 
    df[i] = pd.read_excel(xls, sheet_name)
  • Related