-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Add new implementation of DataFrame.stack #53921
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
Conversation
How do you see the deprecation/update process? If we don't yet warn in 2.1, I doubt that many users will already try out |
Instead of a v3 keyword could use the "future" option from #53025 |
I was thinking we add the deprecation in 2.2; I agree not many will use For doing the deprecation, we could get really complicated. I think behavior is the same when:
However, since we'd be deprecating
I'd definitely be on board with this. |
…new_stack � Conflicts: � pandas/core/frame.py � pandas/core/reshape/reshape.py � pandas/tests/frame/test_stack_unstack.py
@jbrockmendel @jorisvandenbossche @mroeschke assuming the CI agrees I think this is ready for review. @jbrockmendel - regarding using a |
Definitely not |
@@ -582,7 +587,7 @@ def stack(frame: DataFrame, level=-1, dropna: bool = True, sort: bool = True): | |||
stacked : Series or DataFrame | |||
""" | |||
|
|||
def factorize(index): | |||
def stack_factorize(index): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter didn't like that this was named factorize
now that we import factorize
as well, and rightfully so.
Thanks @mroeschke - I think this is good for another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Just a code check failure
…new_stack � Conflicts: � pandas/tests/indexes/datetimes/test_partial_slicing.py
Awesome, thanks @rhshadrach |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.We can either deprecate the current implementation in 2.1, or wait until 2.2. It's slightly more gradual to wait until 2.2; users in 2.1 could opt into the new behavior without any warnings.