-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: clarify "inplace"-ness of DataFrame.setitem #51328
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
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.
@loicdiridollou thanks a lot for the PR! I think the general wording is good, I just added a few tiny comments.
pandas/core/frame.py
Outdated
``frame.isetimtem(loc, value)`` is an in-place method as it will | ||
modify the frame in place (not returning a new object) but it will | ||
not update the values of the column itself, it will instead insert | ||
a new array. |
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 would add something like "in contrast to frame.iloc[:, i] = value
which will try to update the existing values 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.
I just made some examples on my side and indeed this is quite important to keep that in the docs, I will update that
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 should be good now, let me know if the phrasing is clear enough
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 should be good now, let me know if the phrasing is clear enough
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
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.
Looks good, thanks!
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
thx @loicdiridollou lets backport, this is nice to have for CoW |
…taFrame.setitem) (#51512) Backport PR #51328: DOC: clarify "inplace"-ness of DataFrame.setitem Co-authored-by: Loic Diridollou <[email protected]> Co-authored-by: Patrick Hoefler <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.