PDEP-7: https://pandas.pydata.org/pdeps/0007-copy-on-write.html
An initial implementation was merged in #46958 (with the proposal described in more detail in https://docs.google.com/document/d/1ZCQ9mx3LBMy-nhwRl33_jgcvWo9IWdEfxDNQ2thyTb0/edit / discussed in #36195).
In #36195 (comment) I mentioned some next steps that are still needed; moving this to a new issue.
Implementation
Complete the API surface:
Improve the performance
Provide upgrade path:
Documentation / feedback
Aside from finalizing the implementation, we also need to start documenting this, and it will be super useful to have people give this a try, run their code or test suites with it, etc, so we can iron out bugs / missing warnings / or discover unexpected consequences that need to be addressed/discussed.
Some remaining aspects of the API to figure out:
PDEP-7: https://pandas.pydata.org/pdeps/0007-copy-on-write.html
An initial implementation was merged in #46958 (with the proposal described in more detail in https://docs.google.com/document/d/1ZCQ9mx3LBMy-nhwRl33_jgcvWo9IWdEfxDNQ2thyTb0/edit / discussed in #36195).
In #36195 (comment) I mentioned some next steps that are still needed; moving this to a new issue.
Implementation
Complete the API surface:
copykeyword?copykeyword in DataFrame/Series methods #50535 -> CoW: Ignore copy=True when copy_on_write is enabled #51464copykeyword (except in constructors) #56022.values,to_numpy()). Potential idea is to make the returned array read-only by default.*argsor**kwargs#56456df['a'].fillna(.., inplace=True)Improve the performance
Provide upgrade path:
Documentation / feedback
Aside from finalizing the implementation, we also need to start documenting this, and it will be super useful to have people give this a try, run their code or test suites with it, etc, so we can iron out bugs / missing warnings / or discover unexpected consequences that need to be addressed/discussed.
Some remaining aspects of the API to figure out:
Series.view()method -> is deprecatedhead()/tail()return eager copies? (to avoid using those methods for exploration trigger CoW) -> API/CoW: Return copies for head and tail #54011