使用Tablib加载Excel文件时选择Excel工作表的名称 [英] Selecting name of the excel sheet while loading an excel file with tablib

查看:112
本文介绍了使用Tablib加载Excel文件时选择Excel工作表的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel文件可以加载4张纸.我要从中加载特定的工作表.如何选择工作表的名称?

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')

推荐答案

您可以尝试以下操作:

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

这篇关于使用Tablib加载Excel文件时选择Excel工作表的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆