Skip to content

Commit

Permalink
DOC: Fix PR01 errors in multiple files (pandas-dev#57438)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Deen-dot committed Feb 19, 2024
1 parent 2ef7eb3 commit ccaf2c8
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 15 deletions.
15 changes: 0 additions & 15 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.DatetimeIndex.std\
pandas.ExcelFile\
pandas.ExcelFile.parse\
pandas.Grouper\
pandas.HDFStore.append\
pandas.HDFStore.put\
pandas.Index.get_indexer_for\
Expand Down Expand Up @@ -1538,21 +1537,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.api.types.is_float\
pandas.api.types.is_hashable\
pandas.api.types.is_integer\
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.filter\
pandas.core.groupby.SeriesGroupBy.nunique\
pandas.core.groupby.SeriesGroupBy.pct_change\
pandas.core.groupby.SeriesGroupBy.rolling\
pandas.core.resample.Resampler.max\
pandas.core.resample.Resampler.min\
pandas.core.resample.Resampler.quantile\
Expand Down
9 changes: 9 additions & 0 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,11 @@ def nunique(self, dropna: bool = True) -> Series | DataFrame:
"""
Return number of unique elements in the group.
Parameters
----------
dropna : bool, default True
Don't include NaN in the counts.
Returns
-------
Series
Expand Down Expand Up @@ -1942,6 +1947,10 @@ def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame:
dropna : bool
Drop groups that do not pass the filter. True by default; if False,
groups that evaluate False are filled with NaNs.
*args
Additional positional arguments to pass to `func`.
**kwargs
Additional keyword arguments to pass to `func`.
Returns
-------
Expand Down
56 changes: 56 additions & 0 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -4672,6 +4672,13 @@ def cumprod(self, *args, **kwargs) -> NDFrameT:
"""
Cumulative product for each group.
Parameters
----------
*args : tuple
Positional arguments to be passed to `func`.
**kwargs : dict
Additional/specific keyword arguments to be passed to the function, such as `numeric_only` and `skipna`.
Returns
-------
Series or DataFrame
Expand Down Expand Up @@ -4721,6 +4728,13 @@ def cumprod(self, *args, **kwargs) -> NDFrameT:
def cumsum(self, *args, **kwargs) -> NDFrameT:
"""
Cumulative sum for each group.
Parameters
----------
*args : tuple
Positional arguments to be passed to `func`.
**kwargs : dict
Additional/specific keyword arguments to be passed to the function, such as `numeric_only` and `skipna`.
Returns
-------
Expand Down Expand Up @@ -4776,6 +4790,14 @@ def cummin(
"""
Cumulative min for each group.
Parameters
----------
numeric_only : bool, default False
Include only `float`, `int` or `boolean` data.
**kwargs : dict, optional
Additional keyword arguments to be passed to the function, such as `skipna`, to control whether
NA/null values are ignored.
Returns
-------
Series or DataFrame
Expand Down Expand Up @@ -4838,6 +4860,14 @@ def cummax(
"""
Cumulative max for each group.
Parameters
----------
numeric_only : bool, default False
Include only `float`, `int` or `boolean` data.
**kwargs : dict, optional
Additional keyword arguments to be passed to the function, such as `skipna`, to control whether
NA/null values are ignored.
Returns
-------
Series or DataFrame
Expand Down Expand Up @@ -5134,6 +5164,32 @@ def pct_change(
"""
Calculate pct_change of each value to previous entry in group.
Parameters
----------
periods : int, default 1
Periods to shift for calculating percentage change. (E.g., 1
compares adjacent elements, while a period of 2 compares every other element).
fill_method : FillnaOptions or None, default None
This parameter specifies how to handle missing values after the initial shift operation
that is necessary for calculating the percentage change. In future versions, users will be
encouraged to manually handle missing values prior to using `pct_change`. Options for fill methods
(when explicitly specified) are as follows:
- A FillnaOptions value (e.g., 'ffill', 'bfill') to specify forward or backward filling.
- None to indicate that no filling should be performed.
Note: Direct use of this parameter is discouraged due to the impending deprecation.
limit : int or None, default None
The maximum number of consecutive NA values to forward or backward fill, depending on the
`fill_method` chosen. This parameter's functionality is also subject to deprecation, and it is
recommended that NaN values be addressed prior to calling `pct_change`.
freq : str, pandas offset object or None, default None
Increment to use from time series API (e.g., 'M' for month-end frequency). This parameter is
only relevant if the data is time series. If None, the frequency inferred from the index will be used.
Returns
-------
Series or DataFrame
Expand Down
4 changes: 4 additions & 0 deletions pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Grouper:
Parameters
----------
*args
Currently unused, reserved for future use.
**kwargs
Dictionary of the keyword arguments to pass to Grouper.
key : str, defaults to None
Groupby key, which selects the grouping column of the target.
level : name/number, defaults to None
Expand Down

0 comments on commit ccaf2c8

Please sign in to comment.