-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Added test for sort_index parameter multiindex 'sort_remaining' = False #53076
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
Please ensure you run precommit to fix code check issues: https://pandas.pydata.org/docs/development/contributing_codebase.html#contributing-pre-commit |
Hi @mroeschke :) |
|
||
@pytest.mark.parametrize("ascending", [True, False]) | ||
def test_sort_index_multiindex_sort_remaining(self, ascending): | ||
# GH #24247, testing multiindex sort_remaining=false consistent behavior |
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.
You can remove the comment except the gh reference
df_sorted = df.sort_index(level=1, sort_remaining=False, ascending=ascending) | ||
|
||
if ascending: | ||
df_expected = DataFrame( |
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.
can you call result
and expected
?
), | ||
) | ||
|
||
# Assert that the resulting DataFrame is sorted correctly |
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.
Same, can remove comment
Hi @phofl |
You didn't address any of my comments |
Sorry, I forgot to commit :) |
thx @NoyHanan |
Issue fixed on main, added validation tests