If I have two rows in an Excel (.xls) sheet, like a key-value pair, is there a way to get the value (row1) by entering in the key (row0) in xlrd?
For example, if I have (0,0) = COLOR and (1,0) = RED, how would I do something like:
value = sh.col_values("COLOR") ?
The closest I have been able to find is sh.col_values(int), but that only allows me to enter in an index.
You have to search down the column until you find
COLORthen get the value in the next row.If you knew the keys were in even or odd rows you could use
xrange(0, sheet.nrows, 2)orxrange(1, sheet.nrows, 2)instead.Edit: Updated to search columns as well.