Skip to content

Commit

Permalink
DOC: Fix docstrings for SeriesGroupBy monotonic and nth (#60375)
Browse files Browse the repository at this point in the history
* fix docstrings and remove from code_checks.sh

* fix SeriesGroupBy.is_monotonic_decreasing See Also section (decreasing -> increasing)

* remove DataFrameGroupBy.nth from code_checks.sh

---------

Co-authored-by: root <[email protected]>
  • Loading branch information
ensalada-de-pollo and root authored Nov 20, 2024
1 parent ff53ca1 commit 24df015
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \
-i "pandas.core.groupby.DataFrameGroupBy.indices SA01" \
-i "pandas.core.groupby.DataFrameGroupBy.nth PR02" \
-i "pandas.core.groupby.DataFrameGroupBy.nunique SA01" \
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
-i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \
-i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \
-i "pandas.core.groupby.SeriesGroupBy.indices SA01" \
-i "pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing SA01" \
-i "pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing SA01" \
-i "pandas.core.groupby.SeriesGroupBy.nth PR02" \
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
-i "pandas.core.groupby.SeriesGroupBy.sem SA01" \
-i "pandas.core.resample.Resampler.get_group RT03,SA01" \
Expand Down
10 changes: 10 additions & 0 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,11 @@ def is_monotonic_increasing(self) -> Series:
-------
Series
See Also
--------
SeriesGroupBy.is_monotonic_decreasing : Return whether each group's values
are monotonically decreasing.
Examples
--------
>>> s = pd.Series([2, 1, 3, 4], index=["Falcon", "Falcon", "Parrot", "Parrot"])
Expand All @@ -1462,6 +1467,11 @@ def is_monotonic_decreasing(self) -> Series:
-------
Series
See Also
--------
SeriesGroupBy.is_monotonic_increasing : Return whether each group's values
are monotonically increasing.
Examples
--------
>>> s = pd.Series([2, 1, 3, 4], index=["Falcon", "Falcon", "Parrot", "Parrot"])
Expand Down
13 changes: 0 additions & 13 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -3983,19 +3983,6 @@ def nth(self) -> GroupByNthSelector:
'all' or 'any'; this is equivalent to calling dropna(how=dropna)
before the groupby.
Parameters
----------
n : int, slice or list of ints and slices
A single nth value for the row or a list of nth values or slices.
.. versionchanged:: 1.4.0
Added slice and lists containing slices.
Added index notation.
dropna : {'any', 'all', None}, default None
Apply the specified dropna operation before counting which row is
the nth row. Only supported if n is an int.
Returns
-------
Series or DataFrame
Expand Down

0 comments on commit 24df015

Please sign in to comment.