-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
sukriti1
commented
Dec 18, 2021
•
edited
Loading
edited
- closes BUG: Concat returns inconsistent MultiIndex #44786
- 1 tests added / passed
- Ensure all linting tests pass, see here for how to run them
- New test added to check if MultiIndex is unique
4dfc240
to
07d896f
Compare
# GH#44786 | ||
df = DataFrame({"col": ["a", "b", "c"]}, index=["1", "2", "2"]) | ||
result = concat([df], keys=["X"]) | ||
assert not result.index.is_unique |
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 make an expected by hand and use tm.assert_frame_equal
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.
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.
closing in favor of #45822 |