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

DEPR: sort=True in DataFrame.unstack and Series.unstack #53915

Open
rhshadrach opened this issue Jun 28, 2023 · 4 comments
Open

DEPR: sort=True in DataFrame.unstack and Series.unstack #53915

rhshadrach opened this issue Jun 28, 2023 · 4 comments
Assignees
Labels
Deprecate Functionality to remove in pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Comments

@rhshadrach
Copy link
Member

The sort argument was added in #53298 because of #15105. Now that users can get the unsorted result, they can use sort=False and call .sort_index after unstacking if they wish to have sorted columns.

@rhshadrach rhshadrach added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Deprecate Functionality to remove in pandas labels Jun 28, 2023
@rhshadrach rhshadrach self-assigned this Jun 28, 2023
@jorisvandenbossche jorisvandenbossche added this to the 2.1 milestone Jul 4, 2023
@jorisvandenbossche
Copy link
Member

The keyword was only added in main (i.e. not yet released), so there is no need to deprecate it first if we still want to change it?

Or it's the default of True that you want to change to False eventually?

@jorisvandenbossche
Copy link
Member

And this is only for unstack, right? (now that the sort keyword has been removed again from stack in #53825)

@rhshadrach
Copy link
Member Author

Or it's the default of True that you want to change to False eventually?

Yes - the goal is to make sort=False the only behavior. So we would deprecate both not specifying sort and specifying sort=True. Then in 3.0, sort would only be able to be False, and we would deprecate the argument entirely.

@mroeschke mroeschke modified the milestones: 2.1, 2.2 Aug 23, 2023
@rhshadrach rhshadrach removed this from the 2.2 milestone Dec 27, 2023
@rhshadrach
Copy link
Member Author

Clearing the milestone, there are currently issues with sort=False. See #55516.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

No branches or pull requests

3 participants