This is my current code. As you can see that I'm fetching a value from every cell from each row by specifying the column index.
for row_cells in sheet.iter_rows(min_row=1, max_row=10):
object = {"key1": str(row_cells[1].value), "Key2": str(row_cells[3].value),
"Key3": str(row_cells[4].value), "Key4": str(row_cells[2].value),
"Key5": str(row_cells[5].value)}
Now, in the given excel sheet, the first row always contains the titles of each column.
Is there a way, where instead of specifying the indexes, I specify the names of the columns and then get a value in the cell. The .upper()
method does give us the value of the uppermost cell of a column.