Skip to content

ENH: Add sparse option in pivot_table / pivot / unstack #14493

Open
@yupbank

Description

@yupbank

A small, complete example of the issue

# Your code here
sparse_df = df.pivot(index='a', columns='b', values='c', aggfunc=lambda x: len(x), sparse=True)

Expected Output

Output of pd.show_versions()

# Paste the output here

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementReshapingConcat, Merge/Join, Stack/Unstack, ExplodeSparseSparse Data Type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions