You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for pandas.DataFrame.rename currently reads
inplace : boolean, default False
Whether to return a new DataFrame. If True then value of copy is ignored.
The sentence "Whether to return a new DataFrame" suggests that setting this parameter to True means a new DataFrame will be returned. The parameter name "inplace" suggests that setting this parameter to True means a new DataFrame will not be returned, which is actually the case.
The only thing in the documentation which concretely specifies the true behavior is the parameter name.
A possible alternate phrasing which suggests the correct thing would be to replace the sentence "Whether to return a new DataFrame" with something like "Modify the DataFrame, instead of returning a new DataFrame."
Same thing for the base class NDFrame and its other derived classes like Panel.
The text was updated successfully, but these errors were encountered:
I very much agree with the original description that the "sense" of the parameter's documentation is wrong. I created a PR (#24037) with an attempt at fixing this, while being somewhat consistent with other "inplace" documentation.
Problem description
The documentation for pandas.DataFrame.rename currently reads
The sentence "Whether to return a new DataFrame" suggests that setting this parameter to True means a new DataFrame will be returned. The parameter name "inplace" suggests that setting this parameter to True means a new DataFrame will not be returned, which is actually the case.
The only thing in the documentation which concretely specifies the true behavior is the parameter name.
A possible alternate phrasing which suggests the correct thing would be to replace the sentence "Whether to return a new DataFrame" with something like "Modify the DataFrame, instead of returning a new DataFrame."
Same thing for the base class NDFrame and its other derived classes like Panel.
The text was updated successfully, but these errors were encountered: