-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
#53718 Added copy_on_write effects on pd.Dataframe.copy() method #54425
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
taytzehao
commented
Aug 5, 2023
- closes DOC: Update the DataFrame.copy docstring to note different behaviour with Copy-on-Write #53718
- All code checks passed.
pandas/core/generic.py
Outdated
|
||
** Copy-on-Write is set to true: ** | ||
|
||
>>> pd.set_option("mode.copy_on_write", 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.
This will set the option to True for all following tests as well, this has to be wrapped in with(pd.options_context...)
pandas/core/generic.py
Outdated
@@ -6584,6 +6584,13 @@ def copy(self, deep: bool_t | None = True) -> Self: | |||
:ref:`gotchas <gotchas.thread-safety>` when copying in a threading | |||
environment. | |||
|
|||
When ``copy_on_write`` in pandas global config is set to ``True``, the | |||
``copy_on_write`` global config take effect even when ``deep=False``. |
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.
``copy_on_write`` global config take effect even when ``deep=False``. | |
``copy_on_write`` global config takes effect even when ``deep=False``. |
pandas/core/generic.py
Outdated
When ``copy_on_write`` in pandas global config is set to ``True``, the | ||
``copy_on_write`` global config take effect even when ``deep=False``. | ||
This means that any changes to the copied data would make a new copy | ||
of the data upon write (and vice versa). o changes would not be reflected |
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 should . o changes
be?
Thanks @taytzehao |
…ethod (pandas-dev#54425) * reformat * iloc * option_context * tab spacing * reformat