Skip to content

Commit 0c25bba

Browse files
committed
fix failing tests
1 parent 1d0ce5d commit 0c25bba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/core/reshape/pivot.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,13 @@ 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-
if index is None:
373-
cols = [columns]
374-
elif is_list_like(index):
375-
cols = index
372+
# cols = []
373+
if is_list_like(index):
374+
cols = index # cols.extend(index)
375+
elif index is not None:
376+
cols = [index]
377+
else:
378+
cols = []
376379
cols.append(columns)
377380

378381
append = index is None

0 commit comments

Comments
 (0)