官方手冊:
[https://openpyxl.readthedocs.io/en/stable/]
列號從數(shù)字變?yōu)樽帜?br>
get_column_letter
列號從字母變?yōu)閿?shù)字
column_index_from_string
from openpyxl.utils import get_column_letter,column_index_from_string
代碼:
import openpyxl
wb = openpyxl.load_workbook("censuspopdata.xlsx")
sheetName = wb.get_sheet_by_name("Population by Census Tract")
row = sheetName.max_row()
print(row)
報錯:
TypeError: 'int' object is not callable
解決方法:
max_row是屬性不是函數(shù)凌净,將括號去掉