Skip to content

Commit 45239a1

Browse files
tune logic and add comments
1 parent c0d0955 commit 45239a1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/io/formats/csvs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ def __init__(self, obj, path_or_buf=None, sep=",", na_rep='',
5151
self.header = header
5252
self.index = index
5353
self.index_label = index_label
54-
if not (self.header or self.index_label):
55-
self.index_label = False
54+
# set defualt index label to False if header is False and
55+
# index_label is not None or False.
56+
if not self.header:
57+
if not self.index_label:
58+
self.index_label = False
5659
self.mode = mode
5760
if encoding is None:
5861
encoding = 'ascii' if compat.PY2 else 'utf-8'

0 commit comments

Comments
 (0)