Skip to content

Make DataFrame.pivot accepts a list of column names as values #17160

Closed
@dclong

Description

@dclong

Problem description

Currently DataFrame.pivot accepts either None or a column name for the option values but not a list of column names.

# this works
df.pivot(values = None)
df.pivot(values = 'column_name')
# this doesn't work
df.pivot(values = ['cn1', 'cn2'])

It is not convenient if I want to create a pivot table for multiple columns at the same time. Of course, we can pass None to values and then select columns we want to. But this is not as convenient.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions