How do I count the number of rows in Excel using Python?

How do I count the number of rows in Excel using Python?
Answer
How to find the total number of rows and columns of an Excel spreadsheet in Python
  1. pd_xl_file = pd. ExcelFile(“sample1.xls”)
  2. df = pd_xl_file. parse(“Sheet1”)
  3. print(df)
  4. dimensions = df. shape.
  5. print(dimensions)
 

Tìm kiếm

Back
Top