Skip to content

BUG: sort_index did not respect ignore_index when not sorting #44065

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

Merged
merged 8 commits into from
Oct 19, 2021

Conversation

saehuihwang
Copy link
Contributor

@jreback jreback added this to the 1.4 milestone Oct 17, 2021
@jreback jreback added Bug Index Related to the Index class or subclasses Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Oct 17, 2021
@@ -418,6 +419,13 @@ def test_sort_index_ignore_index(
tm.assert_frame_equal(result_df, expected_df)
tm.assert_frame_equal(df, DataFrame(original_dict, index=original_index))

def test_respect_ignore_index(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you parameterize on inplace=True/False and ignore_index=True/False and check the cases

@jreback jreback merged commit 306fbf9 into pandas-dev:master Oct 19, 2021
@jreback
Copy link
Contributor

jreback commented Oct 19, 2021

thanks @saehuihwang very nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Index Related to the Index class or subclasses Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrame.sort_index is not accounting for ignore_index=True for some cases
3 participants