python字符串转化

问题遇到的现象和发生背景
import xlrd as xd
data =xd.open_workbook ('豆瓣电影数据.xls') #打开excel表所在路径
sheet = data.sheet_by_name('豆瓣电影数据')  #读取数据,以excel表名来打开
d1 = []
for r in range(sheet.nrows): #将表中数据按行逐步添加到列表中,最后转换为list结构
    data1 = []
    for c in range(sheet.ncols):
        data1.append(sheet.cell_value(r,c))
    d1.append([i for i in data1 if i and i !=''])

print(d1)

我想要达到的结果

img


图片中数字不加引号,不要字符型

望采纳

import xlrd as xd
data =xd.open_workbook ('豆瓣电影数据.xls') #打开excel表所在路径
sheet = data.sheet_by_name('豆瓣电影数据')  #读取数据,以excel表名来打开
d1 = []
for r in range(sheet.nrows): #将表中数据按行逐步添加到列表中,最后转换为list结构
    data1 = []
    for c in range(sheet.ncols):
        data1.append(sheet.cell_value(r,c))
    d1.append([i for i in data1 if i and i !=''])

for item in d1:
    item[0] = int(item[0])
    item[2] = int(item[2])

print(d1)