Skip to content

DOC: Remove RT03 docstring errors for selected methods #57797

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 10 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -623,18 +623,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.DataFrame.mean\
pandas.DataFrame.median\
pandas.DataFrame.min\
pandas.DataFrame.pop\
pandas.DataFrame.prod\
pandas.DataFrame.product\
pandas.DataFrame.reindex\
pandas.DataFrame.reorder_levels\
pandas.DataFrame.sem\
pandas.DataFrame.skew\
pandas.DataFrame.std\
pandas.DataFrame.sum\
pandas.DataFrame.swapaxes\
pandas.DataFrame.to_numpy\
pandas.DataFrame.to_orc\
pandas.DataFrame.to_parquet\
pandas.DataFrame.unstack\
pandas.DataFrame.value_counts\
Expand Down
16 changes: 12 additions & 4 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,7 @@ def to_numpy(
Returns
-------
numpy.ndarray
The NumPy array representing the values in the DataFrame.

See Also
--------
Expand Down Expand Up @@ -2930,7 +2931,7 @@ def to_orc(
engine_kwargs: dict[str, Any] | None = None,
) -> bytes | None:
"""
Write a DataFrame to the ORC format.
Write a DataFrame to the Optimized Row Columnar (ORC) format.

.. versionadded:: 1.5.0

Expand All @@ -2957,7 +2958,8 @@ def to_orc(

Returns
-------
bytes if no path argument is provided else None
bytes if no ``path`` argument is provided else None
Bytes object with DataFrame data if ``path`` is not specified else None.

Raises
------
Expand All @@ -2977,6 +2979,8 @@ def to_orc(

Notes
-----
* Find more information on ORC
`here <https://en.wikipedia.org/wiki/Apache_ORC>`__.
* Before using this function you should read the :ref:`user guide about
ORC <io.orc>` and :ref:`install optional dependencies <install.warn_orc>`.
* This function requires `pyarrow <https://arrow.apache.org/docs/python/>`_
Expand Down Expand Up @@ -5473,7 +5477,7 @@ def rename(

def pop(self, item: Hashable) -> Series:
"""
Return item and drop from frame. Raise KeyError if not found.
Return item and drop it from DataFrame. Raise KeyError if not found.

Parameters
----------
Expand All @@ -5483,6 +5487,7 @@ def pop(self, item: Hashable) -> Series:
Returns
-------
Series
Series representing the item that is dropped.

Examples
--------
Expand Down Expand Up @@ -7612,7 +7617,9 @@ def swaplevel(self, i: Axis = -2, j: Axis = -1, axis: Axis = 0) -> DataFrame:

def reorder_levels(self, order: Sequence[int | str], axis: Axis = 0) -> DataFrame:
"""
Rearrange index levels using input order. May not drop or duplicate levels.
Rearrange index or column levels using input ``order``.

May not drop or duplicate levels.

Parameters
----------
Expand All @@ -7625,6 +7632,7 @@ def reorder_levels(self, order: Sequence[int | str], axis: Axis = 0) -> DataFram
Returns
-------
DataFrame
DataFrame with indices or columns with reordered levels.

Examples
--------
Expand Down
27 changes: 14 additions & 13 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def _get_index_resolvers(self) -> dict[Hashable, Series | MultiIndex]:
@final
def _get_cleaned_column_resolvers(self) -> dict[Hashable, Series]:
"""
Return the special character free column resolvers of a dataframe.
Return the special character free column resolvers of a DataFrame.

Column names with special characters are 'cleaned up' so that they can
be referred to by backtick quoting.
Expand Down Expand Up @@ -5077,7 +5077,8 @@ def reindex(

Returns
-------
{klass} with changed index.
{klass}
{klass} with changed index.

See Also
--------
Expand All @@ -5095,7 +5096,7 @@ def reindex(
We *highly* recommend using keyword arguments to clarify your
intent.

Create a dataframe with some fictional data.
Create a DataFrame with some fictional data.

>>> index = ["Firefox", "Chrome", "Safari", "IE10", "Konqueror"]
>>> columns = ["http_status", "response_time"]
Expand All @@ -5112,9 +5113,9 @@ def reindex(
IE10 404 0.08
Konqueror 301 1.00

Create a new index and reindex the dataframe. By default
Create a new index and reindex the DataFrame. By default
values in the new index that do not have corresponding
records in the dataframe are assigned ``NaN``.
records in the DataFrame are assigned ``NaN``.

>>> new_index = ["Safari", "Iceweasel", "Comodo Dragon", "IE10", "Chrome"]
>>> df.reindex(new_index)
Expand Down Expand Up @@ -5167,7 +5168,7 @@ def reindex(
Konqueror 301 NaN

To further illustrate the filling functionality in
``reindex``, we will create a dataframe with a
``reindex``, we will create a DataFrame with a
monotonically increasing index (for example, a sequence
of dates).

Expand All @@ -5184,7 +5185,7 @@ def reindex(
2010-01-05 89.0
2010-01-06 88.0

Suppose we decide to expand the dataframe to cover a wider
Suppose we decide to expand the DataFrame to cover a wider
date range.

>>> date_index2 = pd.date_range("12/29/2009", periods=10, freq="D")
Expand Down Expand Up @@ -5222,12 +5223,12 @@ def reindex(
2010-01-06 88.0
2010-01-07 NaN

Please note that the ``NaN`` value present in the original dataframe
Please note that the ``NaN`` value present in the original DataFrame
(at index value 2010-01-03) will not be filled by any of the
value propagation schemes. This is because filling while reindexing
does not look at dataframe values, but only compares the original and
does not look at DataFrame values, but only compares the original and
desired indexes. If you do want to fill in the ``NaN`` values present
in the original dataframe, use the ``fillna()`` method.
in the original DataFrame, use the ``fillna()`` method.

See the :ref:`user guide <basics.reindexing>` for more.
"""
Expand Down Expand Up @@ -8373,7 +8374,7 @@ def clip(
See Also
--------
Series.clip : Trim values at input threshold in series.
DataFrame.clip : Trim values at input threshold in dataframe.
DataFrame.clip : Trim values at input threshold in DataFrame.
numpy.clip : Clip (limit) the values in an array.

Examples
Expand Down Expand Up @@ -10909,7 +10910,7 @@ def describe(
among those with the highest count.

For mixed data types provided via a ``DataFrame``, the default is to
return only an analysis of numeric columns. If the dataframe consists
return only an analysis of numeric columns. If the DataFrame consists
only of object and categorical data without any numeric columns, the
default is to return an analysis of both the object and categorical
columns. If ``include='all'`` is provided as an option, the result
Expand Down Expand Up @@ -12052,7 +12053,7 @@ def last_valid_index(self) -> Hashable:

**DataFrames**

Create a dataframe from a dictionary.
Create a DataFrame from a dictionary.

>>> df = pd.DataFrame({'col1': [True, True], 'col2': [True, False]})
>>> df
Expand Down