Kul*_*hin 6 python excel openpyxl
是否有任何方法可以使用openpyxl获取.xlsx工作表中存在的行数和列数?在xlrd中,
sheet.ncols
sheet.nrows
Run Code Online (Sandbox Code Playgroud)
会给列和行计数.openpyxl中有没有这样的方法?
Ale*_*ggs 10
给定一个变量sheet,可以通过以下两种方式之一来确定行数和列数:
rows = sheet.nrows
columns = sheet.ncols
Run Code Online (Sandbox Code Playgroud)
rows = sheet.max_row
columns = sheet.max_column
Run Code Online (Sandbox Code Playgroud)