Skip to content

add-pandas-inplace-parameter-set-checker #26

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
PeterHamfelt opened this issue Apr 12, 2024 · 0 comments · Fixed by #40
Closed

add-pandas-inplace-parameter-set-checker #26

PeterHamfelt opened this issue Apr 12, 2024 · 0 comments · Fixed by #40
Assignees
Labels
Enhancement ✨ New feature or request

Comments

@PeterHamfelt
Copy link
Member

PeterHamfelt commented Apr 12, 2024

Avoid using pandas inplace=True parameter.

  1. Clarity and Maintainability: Code that uses inplace=True can be harder to read and maintain, as the changes to the DataFrame or Series are not immediately visible, leading to possible side effects.
  2. Performance: The perceived performance benefits of inplace=True are often misunderstood. In many cases, pandas creates a copy of the data anyway, so the memory and performance advantages may be negligible.
  3. Chained Operations: Using inplace=True in chained operations can lead to errors since the result of an inplace operation is None.

References
https://stackoverflow.com/questions/43893457/understanding-inplace-true-in-pandas
pandas-dev/pandas#16529

@PeterHamfelt PeterHamfelt added the Enhancement ✨ New feature or request label Apr 12, 2024
@PeterHamfelt PeterHamfelt self-assigned this Apr 12, 2024
@PeterHamfelt PeterHamfelt linked a pull request Aug 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant