Skip to content

Conversation

@rhshadrach
Copy link
Member

In the previous implementation, we assumed that if idx is a tuple that we were stacking multiple levels and hence did not need to wrap it in a tuple. However you can have columns consist of tuples that are not a MultiIndex, and then when stacking (the only level) you still want to wrap in a tuple.

@rhshadrach rhshadrach added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Sep 2, 2023
@rhshadrach rhshadrach added this to the 2.1.1 milestone Sep 2, 2023
@phofl phofl merged commit 1605bdf into pandas-dev:main Sep 2, 2023
@phofl
Copy link
Member

phofl commented Sep 2, 2023

thx @rhshadrach

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Sep 2, 2023
phofl pushed a commit that referenced this pull request Sep 2, 2023
…stack=True failing when columns are tuples) (#54971)

Backport PR #54962: BUG: DataFrame.stack with future_stack=True failing when columns are tuples

Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com>
@rhshadrach rhshadrach deleted the regr_future_stack_with_tuple_index branch September 3, 2023 13:34
mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: different behavior of stack(future_stack=True) and stack(future_stack=False)

2 participants