-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode
Milestone
Description
From docstring, index
and values
can be optional in df.pivot, but columns
is not
index : string or object, optional
Column to use to make new frame’s index. If None, uses existing index.
columns : string or object
Column to use to make new frame’s columns.
However, the error message is confusing now, should raise columns
is not optional.
Code example:
>>> df = pd.DataFrame({"foo": ['one', 'one', 'two', 'two'],"bar": ['A', 'A', 'B', 'C'],"baz": [1, 2, 3, 4]})
>>> df.pivot(columns=None)
KeyError: 'None of [None] are in the columns'
Metadata
Metadata
Assignees
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode