pandas.read_excel parameter “sheet_name” not working

后端 未结 4 1882
-上瘾入骨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:24

    This works:

    df = pd.read_excel(open(file_path_name), 'rb'), sheetname = sheet_name)
    
    file_path_name = your file
    sheet_name = your sheet name
    

    This does not for me:

    df = pd.read_excel(open(file_path_name), 'rb'), sheet_name = sheet_name)
    

    Gave me only the first sheet, no matter how I defined sheet_name.

    --> it is an known error: https://github.com/pandas-dev/pandas/issues/17107

提交回复
热议问题