Skip to content

sync "inplace" document strings anywhere possible #47122

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

Merged
merged 19 commits into from
May 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
If 1 or 'columns': apply function to each row.""",
"inplace": """
inplace : bool, default False
If True, performs operation inplace and returns None.""",
Whether to modify the DataFrame rather than creating a new one.""",
"optional_by": """
by : str or list of str
Name or list of names to sort by.
Expand Down Expand Up @@ -4071,8 +4071,7 @@ def query(self, expr: str, inplace: bool = False, **kwargs):
Expanding functionality of backtick quoting for more than only spaces.

inplace : bool
Whether the query should modify the data in place or return
a modified copy.
Whether to modify the DataFrame rather than creating a new one.
**kwargs
See the documentation for :func:`eval` for complete details
on the keyword arguments accepted by :meth:`DataFrame.query`.
Expand Down Expand Up @@ -5175,8 +5174,8 @@ def rename(
copy : bool, default True
Also copy underlying data.
inplace : bool, default False
Whether to return a new DataFrame. If True then value of copy is
ignored.
Whether to modify the DataFrame rather than creating a new one.
If True then value of copy is ignored.
level : int or level name, default None
In case of a MultiIndex, only rename labels in the specified
level.
Expand Down Expand Up @@ -5607,7 +5606,7 @@ def set_index(
append : bool, default False
Whether to append columns to existing index.
inplace : bool, default False
If True, modifies the DataFrame in place (do not create a new object).
Whether to modify the DataFrame rather than creating a new one.
verify_integrity : bool, default False
Check the new index for duplicates. Otherwise defer the check until
necessary. Setting to False will improve the performance of this
Expand Down Expand Up @@ -5884,7 +5883,7 @@ def reset_index(
Do not try to insert index into dataframe columns. This resets
the index to the default integer index.
inplace : bool, default False
Modify the DataFrame in place (do not create a new object).
Whether to modify the DataFrame rather than creating a new one.
col_level : int or str, default 0
If the columns have multiple levels, determines which level the
labels are inserted into. By default it is inserted into the first
Expand Down Expand Up @@ -6171,7 +6170,7 @@ def dropna(
Labels along other axis to consider, e.g. if you are dropping rows
these would be a list of columns to include.
inplace : bool, default False
If True, do operation inplace and return None.
Whether to modify the DataFrame rather than creating a new one.

Returns
-------
Expand Down Expand Up @@ -6317,7 +6316,7 @@ def drop_duplicates(
- ``last`` : Drop duplicates except for the last occurrence.
- False : Drop all duplicates.
inplace : bool, default False
Whether to drop duplicates in place or to return a copy.
Whether to modify the DataFrame rather than creating a new one.
ignore_index : bool, default False
If True, the resulting axis will be labeled 0, 1, …, n - 1.

Expand Down Expand Up @@ -6691,7 +6690,7 @@ def sort_index( # type: ignore[override]
Sort ascending vs. descending. When the index is a MultiIndex the
sort direction can be controlled for each level individually.
inplace : bool, default False
If True, perform operation in-place.
Whether to modify the DataFrame rather than creating a new one.
kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, default 'quicksort'
Choice of sorting algorithm. See also :func:`numpy.sort` for more
information. `mergesort` and `stable` are the only stable algorithms. For
Expand Down