-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: DataFrame.rename Method #47030
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
Comments
Thanks @MischaDy for the report.
This is the most explicit but the DataFrame is not technically passed by the user, only internally as self? so maybe just "Whether to modify the we use the inplace parameter in several methods, so any changes should be consistent across all methods. contributions and PRs welcome. |
Thanks @simonjayhawkins for the super-quick reply!
Yes, that's correct, my bad.
Yes, I think that's the best option!
I totally agree, this was just the first method I noticed this for.
Oh, I can directly modify the docs and then do a pull request? If so, I'll be happy to do so :) |
|
Hi @MischaDy @simonjayhawkins I would like to Contribute, is this Issue still open? |
Hi @Sumanth077, yes I think so! There should be quite a few more methods using inplace that can be adapted. |
take |
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.rename.html#pandas.DataFrame.rename
Documentation problem
The docs for the
inplace
parameter state: "Whether to return a newDataFrame
. (...)". However, it is clear that the boolean has the opposite meaning: Ifinplace=True
, no newDataFrame
will be returned and vice versa.Suggested fix for documentation
Something along the lines of: "Whether not to return a new
DataFrame
. (...)"Or, perhaps more intuitively: "Whether to modify the
DataFrame
passed as input. (...)"Possibly with an enhancing addition: "Whether to modify the
DataFrame
passed as input, rather than creating a new one."These suggestions improve the docs, because the boolean value of
inplace
then corresponds to rather than opposes the actual actions taken by the result. Skimming the docs, one might think that the parameter does the opposite of what the docs say, despite its name. Or, alternatively, one might stumble when reading it, and get the intended meaning afterwards. In any case, it is an unneeded distraction.The text was updated successfully, but these errors were encountered: