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

Remove set on copy using inplace=True #35

Open
andywong36 opened this issue Jun 17, 2024 · 0 comments
Open

Remove set on copy using inplace=True #35

andywong36 opened this issue Jun 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@andywong36
Copy link
Contributor

Currently getting this warning.

df_mapping[fname].fillna(midpoints, inplace=True)

/home/__REDACTED__/lib/python3.9/site-packages/foundry/evaluation/marginal_effects.py:492: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.
@andywong36 andywong36 added the bug Something isn't working label Jun 17, 2024
@andywong36 andywong36 self-assigned this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant