Skip to content

Commit 118ba81

Browse files
gfyoungjreback
authored andcommitted
REF: Move Excel names parameter handling to CSV (#23690)
1 parent 6f8c6e1 commit 118ba81

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/io/excel.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ def _parse_cell(cell_contents, cell_typ):
660660
# GH 12292 : error when read one empty column from excel file
661661
try:
662662
parser = TextParser(data,
663+
names=names,
663664
header=header,
664665
index_col=index_col,
665666
has_index_names=has_index_names,
@@ -681,9 +682,6 @@ def _parse_cell(cell_contents, cell_typ):
681682

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

684-
if names is not None:
685-
output[asheetname].columns = names
686-
687685
if not squeeze or isinstance(output[asheetname], DataFrame):
688686
output[asheetname].columns = output[
689687
asheetname].columns.set_names(header_names)

0 commit comments

Comments
 (0)