Read data in Excel column into Python list

前端 未结 5 1004
囚心锁ツ
囚心锁ツ 2020-12-31 10:16

I am using python xlwings to read a column of data in Excel 2013. Column A is populated with numbers. To import this column into a python list py_list

5条回答
  •  隐瞒了意图╮
    2020-12-31 10:38

    The key to this question is finding out the number of rows in column A.

    The number of rows can be found with this single line using xlwings below;

    rownum = sht.range('A1').end('down').last_cell.row
    

    One needs to read the API documentation carefully to get the answer.

    http://docs.xlwings.org/en/stable/api.html#xlwings.Range

    Once the number of rows is found, it is easy to figure out the rest.

提交回复
热议问题