Selecting name of the excel sheet while loading an excel file with tablib

♀尐吖头ヾ 提交于 2021-01-29 12:43:06

问题


I have an excel file to load with 4 sheets. I want to load a specific sheet from. How can I choose the name of the sheet?

This doesn't help. I can't choose a specific sheet.

imported_data= dataset.load(file.read( ), format= 'xlsx')

回答1:


You can try the following:

for dataset in imported_data.sheets():
    print(dataset.title)  # returns the names of the sheets
    print(dataset)  # returns the data in each sheet


来源:https://stackoverflow.com/questions/63030949/selecting-name-of-the-excel-sheet-while-loading-an-excel-file-with-tablib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!