-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Add comment about inplace/copy proposal #51487
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
doc/source/whatsnew/v2.0.0.rst
Outdated
@@ -1423,6 +1423,15 @@ Metadata | |||
|
|||
Other | |||
^^^^^ | |||
|
|||
.. note:: |
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.
This seems to be a bit strange location to put it? (inside a "Bugs" subsection)
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.
Yeah good point, but did not want to put it right at the top, so not really sure where to place it
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.
We could put it under other api changes?
|
||
.. code-block:: python | ||
|
||
df.replace(5, inplace=True) |
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.
I don't think replace is a good example. We are keeping inplace
there.
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.
That’s why I am using it. I could add an explicit comment that replace is one of the few methods where we are keeping it
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.
Added a small note that replace might keep inplace
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.
Thanks, it might be good to also give an example of something that would lose inplace, for comparison's sake.
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.
What would you want to show with it? I am struggling to come up with an explanation for such an example
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.
I don't think we would need to go to in detail, just say e.g.
"Some methods cannot operate inplace (e.g. reindex
), or would already avoid copying the data with Copy on Write. (e.g. rename
)
It is recommended that the inplace
/copy
parameters be avoided for those methods".
No big deal if we don't add this, though, since people can always read the PDEP.
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.
Ah got you, I thought you wanted to add a code example.
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.
I'll leave the suggestion to not use them out. When used in the appropriate context it can speed up your code. I think it's clear enough that users can figure the consequences out for themself.
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.
LGTM. Thanks for writing this up.
Thx, let’s merge then we‘ll get it into the rc |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.