Skip to content

Copy-on-Write Guide - "Previous behavior" output is what would happen post-migration to CoW #57828

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

Closed
1 task done
gah-bo opened this issue Mar 13, 2024 · 1 comment · Fixed by #57866
Closed
1 task done

Comments

@gah-bo
Copy link

gah-bo commented Mar 13, 2024

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html

Documentation problem

Copy-on-Write (CoW) section of "Previous behavior" states that the behavior before CoW leads to this output:

In [1]: df = pd.DataFrame({"foo": [1, 2, 3], "bar": [4, 5, 6]})

In [2]: subset = df["foo"]

In [3]: subset.iloc[0] = 100

In [4]: df
Out[4]: 
   foo  bar
0    1    4
1    2    5
2    3    6

But that's the behavior that would happen after migrating to CoW

Note: this codeblock seems to be used more than once, each time having this issue

Suggested fix for documentation

Actually show "Previous behavior" on the codeblock

@gah-bo gah-bo added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 13, 2024
@rhshadrach
Copy link
Member

cc @phofl

@rhshadrach rhshadrach added Copy / view semantics and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants