From e429ca6f4e80ea9f1543371b4781c53981f03f3f Mon Sep 17 00:00:00 2001 From: DrIrv Date: Tue, 13 Oct 2015 16:46:18 -0400 Subject: [PATCH] Update parsers.py If the multi-line headers come from Excel, and the header was not a string, the line all(['Unnamed' in c[n] for c in columns]): will fail because c[n] is an int and not iterable. So either force the headers to be strings (the proposed change) or come up with some other test when looking for 'Unnamed' --- pandas/io/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 8ac1aed9d9af7..9d62c0c4b5d8d 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -867,7 +867,7 @@ def _extract_multi_indexer_columns(self, header, index_names, col_names, field_count = len(header[0]) def extract(r): - return tuple([r[i] for i in range(field_count) if i not in sic]) + return tuple([str(r[i]) for i in range(field_count) if i not in sic]) columns = lzip(*[extract(r) for r in header]) names = ic + columns