-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: test CoW for drop_level #50552
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
ENH: test CoW for drop_level #50552
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.
Looks good generally, but needs a rebase and you should install pre-commit locally for linting purposes
assert not np.shares_memory(get_array(df2, "c"), get_array(df, "c")) | ||
|
||
# mutating df2 triggers a copy-on-write for that column / block | ||
df2.loc[4, "c"] = 1 |
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.
Can you create the DataFrame without set_index and also use iloc[0, 0] here?
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 for the contribution! Looks good
Copy on write for droplevel
This PR is part of an effort to implement the Copy-on-Write implementation mentioned in ENH / CoW: Use the "lazy copy" (with Copy-on-Write) optimization in more methods where appropriate #49473. More detail in this proposal https://docs.google.com/document/d/1ZCQ9mx3LBMy-nhwRl33_jgcvWo9IWdEfxDNQ2thyTb0/edit / with discussions in Proposal for future copy / view semantics in indexing operations #36195