Skip to content

Commit d1bc296

Browse files
committed
issue when read_html with previous fix
With read_html, the fix didn't work on Python 2.7. Handle the string conversion correctly
1 parent 6a4c85d commit d1bc296

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/io/parsers.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,12 @@ def _extract_multi_indexer_columns(self, header, index_names, col_names,
865865

866866
# extract the columns
867867
field_count = len(header[0])
868+
869+
def tostr(x):
870+
return str(x) if not isinstance(x, compat.string_types) else x
868871

869872
def extract(r):
870-
return tuple([str(r[i]) for i in range(field_count) if i not in sic])
873+
return tuple([tostr(r[i]) for i in range(field_count) if i not in sic])
871874

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

0 commit comments

Comments
 (0)