Skip to content

Commit

Permalink
DOC: Fix some core.resample.Resampler docstrings (#60502)
Browse files Browse the repository at this point in the history
* fixed resample.Resampler docstring errors in min, max, mean, prod, std, var as indicated by vaildate_docstrings.py

* fixed resample.Resampler docstring errors in min, max, mean, prod, std, var as indicated by vaildate_docstrings.py

* fixed trailing whitespace on line 1161

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthew Roeschke <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2025
1 parent 76a20bd commit b74ee4a
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.arrays.TimedeltaArray PR07,SA01" \
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
-i "pandas.core.resample.Resampler.max PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.mean SA01" \
-i "pandas.core.resample.Resampler.min PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.prod SA01" \
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
-i "pandas.core.resample.Resampler.std SA01" \
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.var SA01" \
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
-i "pandas.plotting.andrews_curves RT03,SA01" \
-i "pandas.tseries.offsets.BDay PR02,SA01" \
Expand Down
75 changes: 75 additions & 0 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,13 @@ def prod(
Series or DataFrame
Computed prod of values within each group.
See Also
--------
core.resample.Resampler.sum : Compute sum of groups, excluding missing values.
core.resample.Resampler.mean : Compute mean of groups, excluding missing values.
core.resample.Resampler.median : Compute median of groups, excluding missing
values.
Examples
--------
>>> ser = pd.Series(
Expand Down Expand Up @@ -1126,9 +1133,30 @@ def min(
"""
Compute min value of group.
Parameters
----------
numeric_only : bool, default False
Include only float, int, boolean columns.
.. versionchanged:: 2.0.0
numeric_only no longer accepts ``None``.
min_count : int, default 0
The required number of valid values to perform the operation. If fewer
than ``min_count`` non-NA values are present the result will be NA.
Returns
-------
Series or DataFrame
Compute the minimum value in the given Series or DataFrame.
See Also
--------
core.resample.Resampler.max : Compute max value of group.
core.resample.Resampler.mean : Compute mean of groups, excluding missing values.
core.resample.Resampler.median : Compute median of groups, excluding missing
values.
Examples
--------
Expand Down Expand Up @@ -1160,9 +1188,30 @@ def max(
"""
Compute max value of group.
Parameters
----------
numeric_only : bool, default False
Include only float, int, boolean columns.
.. versionchanged:: 2.0.0
numeric_only no longer accepts ``None``.
min_count : int, default 0
The required number of valid values to perform the operation. If fewer
than ``min_count`` non-NA values are present the result will be NA.
Returns
-------
Series or DataFrame
Computes the maximum value in the given Series or Dataframe.
See Also
--------
core.resample.Resampler.min : Compute min value of group.
core.resample.Resampler.mean : Compute mean of groups, excluding missing values.
core.resample.Resampler.median : Compute median of groups, excluding missing
values.
Examples
--------
Expand Down Expand Up @@ -1236,6 +1285,16 @@ def mean(
DataFrame or Series
Mean of values within each group.
See Also
--------
core.resample.Resampler.median : Compute median of groups, excluding missing
values.
core.resample.Resampler.sum : Compute sum of groups, excluding missing values.
core.resample.Resampler.std : Compute standard deviation of groups, excluding
missing values.
core.resample.Resampler.var : Compute variance of groups, excluding missing
values.
Examples
--------
Expand Down Expand Up @@ -1285,6 +1344,14 @@ def std(
DataFrame or Series
Standard deviation of values within each group.
See Also
--------
core.resample.Resampler.mean : Compute mean of groups, excluding missing values.
core.resample.Resampler.median : Compute median of groups, excluding missing
values.
core.resample.Resampler.var : Compute variance of groups, excluding missing
values.
Examples
--------
Expand Down Expand Up @@ -1336,6 +1403,14 @@ def var(
DataFrame or Series
Variance of values within each group.
See Also
--------
core.resample.Resampler.std : Compute standard deviation of groups, excluding
missing values.
core.resample.Resampler.mean : Compute mean of groups, excluding missing values.
core.resample.Resampler.median : Compute median of groups, excluding missing
values.
Examples
--------
Expand Down

0 comments on commit b74ee4a

Please sign in to comment.