Skip to content

BUG: pandas.DataFrame().stack() raise an error, while expected is empty #36113

Closed
@evyasonov

Description

@evyasonov
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Code Sample, a copy-pastable example

pandas.DataFrame().stack()
pandas.DataFrame().stack(dropna = True)

Problem description

I expect that stack() of empty dataframe will be empty dataframe and not an exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions