Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

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 <[email protected]>
@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