pandas.read_excel parameter “sheet_name” not working

后端 未结 4 1886
-上瘾入骨i
-上瘾入骨i 2021-02-13 14:21

According to the doc, pandas.read_excel has a parameter sheet_name that allows specifying which sheet is read. But when I am trying to read the second

4条回答
  •  失恋的感觉
    2021-02-13 15:04

    You can try to use pd.ExcelFile:

    xls = pd.ExcelFile('path_to_file.xls')
    df1 = pd.read_excel(xls, 'Sheet1')
    df2 = pd.read_excel(xls, 'Sheet2')
    

提交回复
热议问题