Skip to content

ENH: dataframe.explode() function variant #55063

@jablka

Description

@jablka

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

There is a Dataframe.explode function that explodes list-like data to rows... that is the long format.

I would like to have a similar function, that would expand (or explode) from list-like data to columns (wide format) instead.

Feature Description

new function, that would expand (or explode, or unpack) from list-like data to columns (wide format).

Alternative Solutions

the problem can be also formulated as "splitting column of list-like data".
There are solutions, but not straight-forward.
Split a Pandas column of lists into multiple columns (Stack Overflow)

Additional Context

Q:
in pandas dataframe,
in one column I have list of strings ... like ['str1','str2'].
How to expand (or unpack) those strings to separate columns ?
https://chat.openai.com/c/15a91b3a-c01c-468f-bb1f-19d20c0e1418

Metadata

Metadata

Assignees

Labels

EnhancementReshapingConcat, Merge/Join, Stack/Unstack, Explode

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions