pydata/pandas — Issue #873: Add column slicing to parse() in _parse_xlsx and _parse_xls
Author: bobl2424
Created: 2012-03-06 18:43:52+00:00
State: open

Rather than parsing an entire worksheet, parse a slice of the columns. I don't know how this would work for _parse_xlsx but for _parse_xls the code could be changed, line 671 of parsers.py, from:

for value, typ in izip(sheet.row_values(i), sheet.row_types(i)):

To:

for value, typ in izip(sheet.row_values(i, index_col, None), sheet.row_types(i, index_col, None)):

So, there would be a new parameter to parse(), 'end_col' or 'index_col_offset' or something, passing the column to stop parsing at. The default would be 'None' get all the data in the worksheet. If index_col==None it would need to be zero in the sheet.row_values function.

Just a thought, as it would be nice to pull in just the data you want from a worksheet and not everything in the worksheet. Would be really nice to be able to specify specific columns of data, but I don't know how that would work, it is above my knowledge level.

Thanks, Bob