Skip to content

Commit

Permalink
issue when read_html with previous fix
Browse files Browse the repository at this point in the history
With read_html, the fix didn't work on Python 2.7.  Handle the string
conversion correctly
  • Loading branch information
Dr-Irv committed Oct 14, 2015
1 parent 6a4c85d commit d1bc296
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,12 @@ def _extract_multi_indexer_columns(self, header, index_names, col_names,

# extract the columns
field_count = len(header[0])

def tostr(x):
return str(x) if not isinstance(x, compat.string_types) else x

def extract(r):
return tuple([str(r[i]) for i in range(field_count) if i not in sic])
return tuple([tostr(r[i]) for i in range(field_count) if i not in sic])

columns = lzip(*[extract(r) for r in header])
names = ic + columns
Expand Down

0 comments on commit d1bc296

Please sign in to comment.