Skip to content

Commit

Permalink
fix errant this_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Kandel committed Nov 22, 2016
1 parent 3d9bbdd commit fc23e5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2083,10 +2083,10 @@ def _infer_columns(self):
# We have an empty file, so check
# if columns are provided. That will
# serve as the 'line' for parsing
if have_mi_columns:
if have_mi_columns and hr > 0:
if clear_buffer:
self._clear_buffer()
columns.append([None] * len(this_columns))
columns.append([None] * len(columns[-1]))
return columns, num_original_columns

if not self.names:
Expand Down
2 changes: 1 addition & 1 deletion pandas/parser.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ cdef class TextReader:

# e.g., if header=3 and file only has 2 lines
elif (self.parser.lines < hr + 1
and not isinstance(self.orig_header, list)) or (
and not isinstance(self.orig_header, list)) or (
self.parser.lines < hr):
msg = self.orig_header
if isinstance(msg, list):
Expand Down

0 comments on commit fc23e5c

Please sign in to comment.