Skip to content

Commit 1d0ce5d

Browse files
committed
if-elif
1 parent aaa21bb commit 1d0ce5d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/core/reshape/pivot.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,10 @@ def _convert_by(by):
369369
def pivot(data, index=None, columns=None, values=None):
370370
if values is None:
371371
# Make acceptable for multiple column indexes.
372-
cols = []
373-
if is_list_like(index):
374-
cols.extend(index)
375-
elif index is not None:
376-
cols.extend([index])
372+
if index is None:
373+
cols = [columns]
374+
elif is_list_like(index):
375+
cols = index
377376
cols.append(columns)
378377

379378
append = index is None

0 commit comments

Comments
 (0)