How to obtain sheet names from XLS files without loading the whole file?

后端 未结 6 658
独厮守ぢ
独厮守ぢ 2020-11-29 22:36

I\'m currently using pandas to read an Excel file and present its sheet names to the user, so he can select which sheet he would like to use. The problem is that the files a

6条回答
  •  野性不改
    2020-11-29 23:05

    you can also use

    data=pd.read_excel('demanddata.xlsx',sheet_name='oil&gas')
    print(data)   
    

    Here demanddata is the name of your file oil&gas is one of your sheet name.Let there may be n number of sheet in your worksheet.Just Give the Name of the sheet which you like to fetch at Sheet_name="Name of Your required sheet"

提交回复
热议问题