Skip to content

Commit ccaf2c8

Browse files
committed
DOC: Fix PR01 errors in multiple files (pandas-dev#57438)
Fixed PR01 errors (pandas-dev#57438) and added parameter descriptions for: - `pandas.Grouper` - `pandas.core.groupby.DataFrameGroupBy.cummax` - `pandas.core.groupby.DataFrameGroupBy.cummin` - `pandas.core.groupby.DataFrameGroupBy.cumprod` - `pandas.core.groupby.DataFrameGroupBy.cumsum` - `pandas.core.groupby.DataFrameGroupBy.filter` - `pandas.core.groupby.DataFrameGroupBy.pct_change` - `pandas.core.groupby.DataFrameGroupBy.rolling` - `pandas.core.groupby.SeriesGroupBy.cummax` - `pandas.core.groupby.SeriesGroupBy.cummin` - `pandas.core.groupby.SeriesGroupBy.cumprod` - `pandas.core.groupby.SeriesGroupBy.cumsum` - `pandas.core.groupby.SeriesGroupBy.cumprod` Fixed functions also removed from code_checks.sh
1 parent 2ef7eb3 commit ccaf2c8

File tree

4 files changed

+69
-15
lines changed

4 files changed

+69
-15
lines changed

ci/code_checks.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
14771477
pandas.DatetimeIndex.std\
14781478
pandas.ExcelFile\
14791479
pandas.ExcelFile.parse\
1480-
pandas.Grouper\
14811480
pandas.HDFStore.append\
14821481
pandas.HDFStore.put\
14831482
pandas.Index.get_indexer_for\
@@ -1538,21 +1537,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
15381537
pandas.api.types.is_float\
15391538
pandas.api.types.is_hashable\
15401539
pandas.api.types.is_integer\
1541-
pandas.core.groupby.DataFrameGroupBy.cummax\
1542-
pandas.core.groupby.DataFrameGroupBy.cummin\
1543-
pandas.core.groupby.DataFrameGroupBy.cumprod\
1544-
pandas.core.groupby.DataFrameGroupBy.cumsum\
1545-
pandas.core.groupby.DataFrameGroupBy.filter\
1546-
pandas.core.groupby.DataFrameGroupBy.pct_change\
1547-
pandas.core.groupby.DataFrameGroupBy.rolling\
1548-
pandas.core.groupby.SeriesGroupBy.cummax\
1549-
pandas.core.groupby.SeriesGroupBy.cummin\
1550-
pandas.core.groupby.SeriesGroupBy.cumprod\
1551-
pandas.core.groupby.SeriesGroupBy.cumsum\
15521540
pandas.core.groupby.SeriesGroupBy.filter\
1553-
pandas.core.groupby.SeriesGroupBy.nunique\
1554-
pandas.core.groupby.SeriesGroupBy.pct_change\
1555-
pandas.core.groupby.SeriesGroupBy.rolling\
15561541
pandas.core.resample.Resampler.max\
15571542
pandas.core.resample.Resampler.min\
15581543
pandas.core.resample.Resampler.quantile\

pandas/core/groupby/generic.py

+9
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,11 @@ def nunique(self, dropna: bool = True) -> Series | DataFrame:
723723
"""
724724
Return number of unique elements in the group.
725725
726+
Parameters
727+
----------
728+
dropna : bool, default True
729+
Don't include NaN in the counts.
730+
726731
Returns
727732
-------
728733
Series
@@ -1942,6 +1947,10 @@ def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame:
19421947
dropna : bool
19431948
Drop groups that do not pass the filter. True by default; if False,
19441949
groups that evaluate False are filled with NaNs.
1950+
*args
1951+
Additional positional arguments to pass to `func`.
1952+
**kwargs
1953+
Additional keyword arguments to pass to `func`.
19451954
19461955
Returns
19471956
-------

pandas/core/groupby/groupby.py

+56
Original file line numberDiff line numberDiff line change
@@ -4672,6 +4672,13 @@ def cumprod(self, *args, **kwargs) -> NDFrameT:
46724672
"""
46734673
Cumulative product for each group.
46744674
4675+
Parameters
4676+
----------
4677+
*args : tuple
4678+
Positional arguments to be passed to `func`.
4679+
**kwargs : dict
4680+
Additional/specific keyword arguments to be passed to the function, such as `numeric_only` and `skipna`.
4681+
46754682
Returns
46764683
-------
46774684
Series or DataFrame
@@ -4721,6 +4728,13 @@ def cumprod(self, *args, **kwargs) -> NDFrameT:
47214728
def cumsum(self, *args, **kwargs) -> NDFrameT:
47224729
"""
47234730
Cumulative sum for each group.
4731+
4732+
Parameters
4733+
----------
4734+
*args : tuple
4735+
Positional arguments to be passed to `func`.
4736+
**kwargs : dict
4737+
Additional/specific keyword arguments to be passed to the function, such as `numeric_only` and `skipna`.
47244738
47254739
Returns
47264740
-------
@@ -4776,6 +4790,14 @@ def cummin(
47764790
"""
47774791
Cumulative min for each group.
47784792
4793+
Parameters
4794+
----------
4795+
numeric_only : bool, default False
4796+
Include only `float`, `int` or `boolean` data.
4797+
**kwargs : dict, optional
4798+
Additional keyword arguments to be passed to the function, such as `skipna`, to control whether
4799+
NA/null values are ignored.
4800+
47794801
Returns
47804802
-------
47814803
Series or DataFrame
@@ -4838,6 +4860,14 @@ def cummax(
48384860
"""
48394861
Cumulative max for each group.
48404862
4863+
Parameters
4864+
----------
4865+
numeric_only : bool, default False
4866+
Include only `float`, `int` or `boolean` data.
4867+
**kwargs : dict, optional
4868+
Additional keyword arguments to be passed to the function, such as `skipna`, to control whether
4869+
NA/null values are ignored.
4870+
48414871
Returns
48424872
-------
48434873
Series or DataFrame
@@ -5134,6 +5164,32 @@ def pct_change(
51345164
"""
51355165
Calculate pct_change of each value to previous entry in group.
51365166
5167+
Parameters
5168+
----------
5169+
periods : int, default 1
5170+
Periods to shift for calculating percentage change. (E.g., 1
5171+
compares adjacent elements, while a period of 2 compares every other element).
5172+
5173+
fill_method : FillnaOptions or None, default None
5174+
This parameter specifies how to handle missing values after the initial shift operation
5175+
that is necessary for calculating the percentage change. In future versions, users will be
5176+
encouraged to manually handle missing values prior to using `pct_change`. Options for fill methods
5177+
(when explicitly specified) are as follows:
5178+
5179+
- A FillnaOptions value (e.g., 'ffill', 'bfill') to specify forward or backward filling.
5180+
- None to indicate that no filling should be performed.
5181+
5182+
Note: Direct use of this parameter is discouraged due to the impending deprecation.
5183+
5184+
limit : int or None, default None
5185+
The maximum number of consecutive NA values to forward or backward fill, depending on the
5186+
`fill_method` chosen. This parameter's functionality is also subject to deprecation, and it is
5187+
recommended that NaN values be addressed prior to calling `pct_change`.
5188+
5189+
freq : str, pandas offset object or None, default None
5190+
Increment to use from time series API (e.g., 'M' for month-end frequency). This parameter is
5191+
only relevant if the data is time series. If None, the frequency inferred from the index will be used.
5192+
51375193
Returns
51385194
-------
51395195
Series or DataFrame

pandas/core/groupby/grouper.py

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ class Grouper:
6868
6969
Parameters
7070
----------
71+
*args
72+
Currently unused, reserved for future use.
73+
**kwargs
74+
Dictionary of the keyword arguments to pass to Grouper.
7175
key : str, defaults to None
7276
Groupby key, which selects the grouping column of the target.
7377
level : name/number, defaults to None

0 commit comments

Comments
 (0)