Skip to content
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

Update pandas inplace operation #211

Open
Etrama opened this issue Apr 23, 2024 · 2 comments
Open

Update pandas inplace operation #211

Etrama opened this issue Apr 23, 2024 · 2 comments

Comments

@Etrama
Copy link

Etrama commented Apr 23, 2024

To make sure the code is future proof (pandas 3 proof), all the pandas operations that mention"inplace=True" need to be updated. At the time I checked, this was 53 results in 20 files:
image

No promises, but I might make a pull request that fixes this.

If you need more evidence: stackoverflow post.

@AllenDowney
Copy link
Owner

Thanks for bringing this to my attention, and thanks for the offer to make a PR, but I'll ask you to hold off.

First, a lot of the code in this repo gets generated from other code, so you don't want to modify the ones that get generated.

Second, I am unsure whether I will future-proof this code or not -- I might just pin it to Pandas < 3.0.

Thinking...

@Etrama
Copy link
Author

Etrama commented Apr 27, 2024

Food for thought-
Cons:

  • Extra effort: There are also some explanations in the book's text that would need to be updated if the "inplace" operations were updated.
    image
    image

Pros:

  • Good python and pandas habits inculcated in people who read the book. If newbies aren't exposed to "inplace", I daresay they will stick to what they know. However, one could also argue that people motivated enough would find this out themselves.

I'll leave the final decision to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants