Skip to content

Commit

Permalink
REF: Move Excel names parameter handling to CSV (pandas-dev#23690)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and tm9k1 committed Nov 19, 2018
1 parent c06e26c commit e264240
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ def _parse_cell(cell_contents, cell_typ):
# GH 12292 : error when read one empty column from excel file
try:
parser = TextParser(data,
names=names,
header=header,
index_col=index_col,
has_index_names=has_index_names,
Expand All @@ -681,9 +682,6 @@ def _parse_cell(cell_contents, cell_typ):

output[asheetname] = parser.read(nrows=nrows)

if names is not None:
output[asheetname].columns = names

if not squeeze or isinstance(output[asheetname], DataFrame):
output[asheetname].columns = output[
asheetname].columns.set_names(header_names)
Expand Down

0 comments on commit e264240

Please sign in to comment.