Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ENH: reset_index on a MultiIndex with duplicate levels raises a ValueError #44755
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
ENH: reset_index on a MultiIndex with duplicate levels raises a ValueError #44755
Changes from all commits
88cd26f
a23dbdc
b101177
39d9f75
c83b84b
e1a5910
e5ab5f7
b4828e6
d9d60ee
e1bb16f
e924f93
65c6fef
704fae4
2911dd7
96af74d
0e90ae9
170d05f
fe23eeb
a0f0e4c
01ad538
9da58ed
9d988a0
a108a70
13c6dce
2b37ab3
140b5d9
1bd1cbd
e27df82
749838c
c7cf483
7711474
0ecf6fd
0730d7b
99ea2c3
250999a
090468e
14a07e1
8eb8710
18341db
1337283
a8dab78
95cc65b
7de074c
bb54268
01136ae
d21846b
3ef667c
22deac4
540b307
8cc81b0
fc74265
a59644a
b774598
67a5956
e88b8e2
9ad3026
1fdc39f
7639464
c58d992
e07eea6
04b3a38
2f94170
9241f96
0b84426
c2bed8f
3530ca8
dddae07
14edbdb
8383572
37cc560
3625d77
9d0f798
e2fbf3e
0b2a9d1
c5618c8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
shouldnt we do the same as you are doing in insert and just set this here e.g.
simpler & more readable
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.
@jreback Your suggestion has got to be a typo. That change would render the argument always
False
and fail my tests.If I take out the next line, which is type-checking, then I will have to take out my test https://github.com/johnzangwill/pandas/blob/dddae0734e37ab9fa4ae4a89e68043c4631fd68c/pandas/tests/frame/methods/test_reset_index.py#L474
If I copy in the code from
insert
, then thelib.no_default
no longer has any function.I only used
lib.no_default
to avoid your original objections to this argument. I don't like it, because it makes no sense in the documentation and disguises the real default, which isFalse
.I would be more than happy to take it out and go back to the original much simpler
allow_duplicates: bool = False
, which is the case forinsert
in main and forSeries
in this PR: https://github.com/johnzangwill/pandas/blob/dddae0734e37ab9fa4ae4a89e68043c4631fd68c/pandas/core/series.py#L1369@jreback Let me know what you want:
lib.no_default
and have all the argumentsallow_duplicates: bool = False
cc @rhshadrach, @phofl, @mroeschke. Comments on this?