-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Start migration guide for Copy-on-Write #56298
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.
Nice start! Some quick comments
Would it be worth to also explicitly call out df["col"].fillna(.., inplace=True)
style chained method that will no longer work? (or as second example under "Only one pandas object is updated at once")
The following sections will explain what this means and how it impacts existing | ||
applications. | ||
|
||
Migrating to Copy-on-Write | ||
-------------------------- |
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 wonder if we should move the migration guide further in the file, as right now this section assumes somewhat knowledge about what CoW is, but that is only explained "Description" section that now comes afterwards
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 had similar thoughts, but I wanted to put it as prominent as possible
Creating a copy of this array allows modification. You can also make the array | ||
writeable again if you don't care about the pandas object anymore. | ||
|
||
**Only one pandas object is updated at once** |
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.
The code example you use is already a practical example of it, but I wonder if we should explicitly call out "modifying a column as a Series no longer works"? As I think this will be one of the main use cases where right now the user intended the propagation of the modification (while with dataframe row slices, I think that is much less the case)
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.
Yep added
See the section about :ref:`read-only NumPy arrays <copy_on_write_read_only_na>` | ||
for more details. |
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 "see also" probably belongs in the section above "Accessing the underlying array of a pandas object will return a read-only view"
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
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]>
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
I think we should link from the FutureWarning to this section as well, but that can be a follow up |
Co-authored-by: Joris Van den Bossche <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.