如下所示:
#读入no
data = xlrd.open_workbook("no.xlsx") #打开excel
table = data.sheet_by_name("Sheet1") #读sheet
nrows = table.nrows
cols = table.ncols
nos = []
for i in range(1,nrows): #指定从1开始,到最后一列,跳过表头
for j in range(cols):
ctype = table.cell(i , j).ctype #判断python读取的返回类型 0 --empty,1 --string, 2 --numb