Xlrd读取Excel
import xlrd
workbook = xlrd.open_workbook(r'E:\py_shiyan\lianxi\遍历文件夹\test.xlsx')
print(workbook.sheet_names())
sheet2_name = workbook.sheet_names()[1]# sheet索引从0开始
sheet2 = workbook.sheet_by_name('sheet2')
# sheet的名称,行数,列数
print (sheet2.name,sheet2.nrows,sheet2.ncols)
rows = sheet2.row_values(3) # 获取第四行内容
cols = sheet2.col_values(2) # 获取第三列内容
print(rows)
print(cols)
pandas读取Excel
# da=