How can I skip first several lines of the Excel sheet?

痴心易碎 提交于 2019-11-29 17:02:54

You can pass a range into ws.iter_rows('A4:Z256') but you're probably better off using ws.get_squared_range(1, 5,)

You can skip the first N rows by passing the optional min_row argument. Note that this uses a 1-base index, so min_row=2 starts on the second row and min_row=5 skips the first four rows. You would be using something like this:

for index, row in enumerate(ws.iter_rows(min_row=5)):

Full iter_rows documentation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!