-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: behavior of copy
argument in df.reindex
is confusing
#34663
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
Comments
Even though the "equivalent" criterion is maybe too strict or not very clear (two things that might be worth solving for sure), there is still value in having this keyword for the case you really have an identical index. |
copy
argument in df.reindex
is confusing and doesn't achieve anythingcopy
argument in df.reindex
is confusing
The |
Or maybe just leave it as a parameter that user define to return an object or not?
|
Again this is something that could be clarified in the docstring, but this behaviour of |
This was inspired by #33888 and #34584
Problem description
The behavior of
copy
argument indf.reindex
is confusing. Current docstring does it explain it sufficiently clear. It also seems to mecopy
is unnecessary.Currently the docstring says
It is hard to clarify what is considered an "equivalent" index. See below for more details.
Further, I believe users rarely purposefully tries to
reindex
with an "equivalent" index. It happens only if the user does not yet know the current index or the index to conform to, in which case a consistent behavior (e.g. always return new object) is probably preferred.You can see it is actually pretty strict to be "equivalent". I feel it does really make sense to have this
copy
parameter becausereindex
will return a new object in most cases anyway even whencopy=False
.So the question is, can we deprecate
copy
?The text was updated successfully, but these errors were encountered: