diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 25317a08ca7b0..f0d798312c0c3 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -134,14 +134,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.dt.tz_localize PR01,PR02" \ -i "pandas.Series.dt.unit GL08" \ -i "pandas.Series.pad PR01,SA01" \ - -i "pandas.Series.sem PR01,RT03,SA01" \ -i "pandas.Series.sparse PR01,SA01" \ -i "pandas.Series.sparse.fill_value SA01" \ -i "pandas.Series.sparse.from_coo PR07,SA01" \ -i "pandas.Series.sparse.npoints SA01" \ -i "pandas.Series.sparse.sp_values SA01" \ -i "pandas.Series.sparse.to_coo PR07,RT03,SA01" \ - -i "pandas.Series.std PR01,RT03,SA01" \ -i "pandas.Timedelta.asm8 SA01" \ -i "pandas.Timedelta.ceil SA01" \ -i "pandas.Timedelta.components SA01" \ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index eae3249aa79a4..3109b67a4fc43 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11847,14 +11847,44 @@ def last_valid_index(self) -> Hashable: where N represents the number of elements. numeric_only : bool, default False Include only float, int, boolean columns. Not implemented for Series. +**kwargs : + Additional keywords have no effect but might be accepted + for compatibility with NumPy. Returns ------- -{name1} or {name2} (if level specified) \ +{name1} or {name2} (if level specified) + {return_desc} + +See Also +-------- +{see_also}\ {notes}\ {examples} """ +_sem_see_also = """\ +scipy.stats.sem : Compute standard error of the mean. +{name2}.std : Return sample standard deviation over requested axis. +{name2}.var : Return unbiased variance over requested axis. +{name2}.mean : Return the mean of the values over the requested axis. +{name2}.median : Return the median of the values over the requested axis. +{name2}.mode : Return the mode(s) of the Series.""" + +_sem_return_desc = """\ +Unbiased standard error of the mean over requested axis.""" + +_std_see_also = """\ +numpy.std : Compute the standard deviation along the specified axis. +{name2}.var : Return unbiased variance over requested axis. +{name2}.sem : Return unbiased standard error of the mean over requested axis. +{name2}.mean : Return the mean of the values over the requested axis. +{name2}.median : Return the median of the values over the requested axis. +{name2}.mode : Return the mode(s) of the Series.""" + +_std_return_desc = """\ +Standard deviation over requested axis.""" + _std_notes = """ Notes @@ -12706,8 +12736,8 @@ def make_doc(name: str, ndim: int) -> str: "ddof argument." ) examples = _std_examples - see_also = "" - kwargs = {"notes": _std_notes} + see_also = _std_see_also.format(name2=name2) + kwargs = {"notes": "", "return_desc": _std_return_desc} elif name == "sem": base_doc = _num_ddof_doc @@ -12751,8 +12781,8 @@ def make_doc(name: str, ndim: int) -> str: >>> df.sem(numeric_only=True) a 0.5 dtype: float64""" - see_also = "" - kwargs = {"notes": ""} + see_also = _sem_see_also.format(name2=name2) + kwargs = {"notes": "", "return_desc": _sem_return_desc} elif name == "skew": base_doc = _num_doc