diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 180083dbbb742..8bf5a912e2c0d 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -167,8 +167,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.eq SA01" \ -i "pandas.Series.ge SA01" \ -i "pandas.Series.gt SA01" \ - -i "pandas.Series.kurt RT03,SA01" \ - -i "pandas.Series.kurtosis RT03,SA01" \ -i "pandas.Series.list.__getitem__ SA01" \ -i "pandas.Series.list.flatten SA01" \ -i "pandas.Series.list.len SA01" \ diff --git a/pandas/core/series.py b/pandas/core/series.py index 45fed36899f10..a93b6cf00031e 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -6895,7 +6895,6 @@ def skew( ) @deprecate_nonkeyword_arguments(version="3.0", allowed_args=["self"], name="kurt") - @doc(make_doc("kurt", ndim=1)) def kurt( self, axis: Axis | None = 0, @@ -6903,6 +6902,54 @@ def kurt( numeric_only: bool = False, **kwargs, ): + """ + Return unbiased kurtosis over requested axis. + + Kurtosis obtained using Fisher's definition of + kurtosis (kurtosis of normal == 0.0). Normalized by N-1. + + Parameters + ---------- + axis : {index (0)} + Axis for the function to be applied on. + For `Series` this parameter is unused and defaults to 0. + + For DataFrames, specifying ``axis=None`` will apply the aggregation + across both axes. + + .. versionadded:: 2.0.0 + + skipna : bool, default True + Exclude NA/null values when computing the result. + numeric_only : bool, default False + Include only float, int, boolean columns. + + **kwargs + Additional keyword arguments to be passed to the function. + + Returns + ------- + scalar + Unbiased kurtosis. + + See Also + -------- + Series.skew : Return unbiased skew over requested axis. + Series.var : Return unbiased variance over requested axis. + Series.std : Return unbiased standard deviation over requested axis. + + Examples + -------- + >>> s = pd.Series([1, 2, 2, 3], index=["cat", "dog", "dog", "mouse"]) + >>> s + cat 1 + dog 2 + dog 2 + mouse 3 + dtype: int64 + >>> s.kurt() + 1.5 + """ return NDFrame.kurt( self, axis=axis, skipna=skipna, numeric_only=numeric_only, **kwargs )