AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.01k stars 11.23k forks source link

Update pandas inplace operation #211

Closed Etrama closed 1 month ago

Etrama commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

Food for thought- Cons:

Pros:

I'll leave the final decision to you.

AllenDowney commented 1 month ago

Ok, I have made these changes in the notebooks, solutions, and text.

Etrama commented 1 month ago

Thank you!