Skip to content

Test added to check if MultiIndex is unique #44953

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

Closed
wants to merge 6 commits into from

Conversation

sukriti1
Copy link
Contributor

@sukriti1 sukriti1 commented Dec 18, 2021

@sukriti1 sukriti1 changed the title new test Test added to check if MultiIndex is unique Dec 18, 2021
@jreback jreback added this to the 1.4 milestone Dec 19, 2021
# GH#44786
df = DataFrame({"col": ["a", "b", "c"]}, index=["1", "2", "2"])
result = concat([df], keys=["X"])
assert not result.index.is_unique
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 make an expected by hand and use tm.assert_frame_equal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback @jreback ! I just added an expected index. Now, I am checking if expected index is equal to the result index in tm.assert_frame_equal.

@jreback jreback removed this from the 1.4 milestone Dec 23, 2021
@jreback
Copy link
Contributor

jreback commented Feb 5, 2022

closing in favor of #45822

@jreback jreback closed this Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Concat returns inconsistent MultiIndex
3 participants