我想在excel的一栏中读取数据,这是我的代码:
import xlrd
file_location = "location/file_name.xlsx"
workbook = xlrd.open_workbook(file_location)
sheet = workbook.sheet_by_name('sheet')
x = []
for cell in sheet.col[9]:
if isinstance(cell, float):
x.append(cell)
print(x)
Run Code Online (Sandbox Code Playgroud)
这是错误的,因为工作表中没有名为col [col.num]的方法,但是我只想从第8列(H列)中提取数据,我该怎么办?