-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Adjust user guide for CoW docs #55337
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.
That's some nice content to add to the docs! Added a few small comments
df = pd.DataFrame({"a": [1, 2], "b": [1.5, 2.5]}) | ||
df.to_numpy() | ||
|
||
The array shares data with the DataFrame if the DataFrame consists of only one NumPy array: |
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.
Maybe also mention Series 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.
added
arr = df.to_numpy() | ||
arr.flags.writeable = True | ||
arr[0, 0] = 100 | ||
arr |
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.
Maybe show df
here as well, to show it was updated? Or do we actually not want to show that (since users shouldn't rely on that happening)?
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 I'd prefer not to show this, this example is meant for users that don't care about df anymore
df.iloc[0, 0] = 100 | ||
|
||
No copy is necessary in this example. | ||
Creating multiple references in the same method keeps unnecessary references alive |
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 don't understand the "in the same method" 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.
That should go away, thx
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
…cs) (#55532) Backport PR #55337: DOC: Adjust user guide for CoW docs Co-authored-by: Patrick Hoefler <[email protected]>
This is mostly from my blog post, would like to backport this ideally.