Using Openpyxl and python3.5, I tried to get the first row from an excel sheet using an index, but I made a mistake.
first_row = worksheet.rows[0]
Traceback (most recent call last):
File "<pyshell#54>", line 1, in <module>
first_row = phc_th_sheet.rows[1]
TypeError: 'generator' object is not subscriptable
Regarding getting the first line, I also tried first_row = worksheet (line = 1) # as well as first_row = workheet.rows [: 1]
Does not work. Any suggestions or feature not available in openpyxl? I was in the documentation at https://openpyxl.readthedocs.io/en/default/ , but did not find anything useful for indexing and row selection
source
share