-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: Add inplace argument to pandas.DataFrame.insert
#50303
Comments
Hi, thanks for the issue. I am -1 on this. What would be the advantage of making a copy here? There are other ways of emulating an insert if you want to do method chaining |
@phofl the advantage is consistency to the rest of the methods, imo |
-1 as well and we r actively going to be deprecating inplace soon |
@jreback I see, but then |
it's been the case since the very beginning of time (update as well) |
agreed on not adding |
-1 on this as well. There seem to be relative agreement among the core devs in not going forward with this, so I'm closing this. Thanks for the proposal though @bhvieira. |
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
Currently, most methods only make in-place alterations when explicitly told to (default is
inplace = False
).pandas.DataFrame.insert
is an exception, working in true OOP-way. There is not even aninplace
argument for it.I don't know if there is any justification for this choice, but I would expect this method to work as the others.
If this is desirable, I can work on this as well.
Feature Description
Add a new
inplace
parameter for thepandas.DataFrame.insert
. Initally, its default will beinplace = True
, with a deprecation warning. In a future breaking change, it could be changed toinplace = False
Alternative Solutions
I'm not aware of an alternative solution,
pandas.DataFrame.insert
returnsNone
, like other methods with theinplace=True
parameter.Additional Context
No response
The text was updated successfully, but these errors were encountered: