Skip to content

Commit 33682b5

Browse files
DOC: add RT03,SA01 for pandas.Series.kurt and pandas.Series.kurtosis (#58761)
* DOC: add RT03,SA01 for pandas.Series.kurt * DOC: remove RT03,SA01 for pandas.Series.kurt
1 parent 058127c commit 33682b5

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
167167
-i "pandas.Series.eq SA01" \
168168
-i "pandas.Series.ge SA01" \
169169
-i "pandas.Series.gt SA01" \
170-
-i "pandas.Series.kurt RT03,SA01" \
171-
-i "pandas.Series.kurtosis RT03,SA01" \
172170
-i "pandas.Series.list.__getitem__ SA01" \
173171
-i "pandas.Series.list.flatten SA01" \
174172
-i "pandas.Series.list.len SA01" \

pandas/core/series.py

+48-1
Original file line numberDiff line numberDiff line change
@@ -6895,14 +6895,61 @@ def skew(
68956895
)
68966896

68976897
@deprecate_nonkeyword_arguments(version="3.0", allowed_args=["self"], name="kurt")
6898-
@doc(make_doc("kurt", ndim=1))
68996898
def kurt(
69006899
self,
69016900
axis: Axis | None = 0,
69026901
skipna: bool = True,
69036902
numeric_only: bool = False,
69046903
**kwargs,
69056904
):
6905+
"""
6906+
Return unbiased kurtosis over requested axis.
6907+
6908+
Kurtosis obtained using Fisher's definition of
6909+
kurtosis (kurtosis of normal == 0.0). Normalized by N-1.
6910+
6911+
Parameters
6912+
----------
6913+
axis : {index (0)}
6914+
Axis for the function to be applied on.
6915+
For `Series` this parameter is unused and defaults to 0.
6916+
6917+
For DataFrames, specifying ``axis=None`` will apply the aggregation
6918+
across both axes.
6919+
6920+
.. versionadded:: 2.0.0
6921+
6922+
skipna : bool, default True
6923+
Exclude NA/null values when computing the result.
6924+
numeric_only : bool, default False
6925+
Include only float, int, boolean columns.
6926+
6927+
**kwargs
6928+
Additional keyword arguments to be passed to the function.
6929+
6930+
Returns
6931+
-------
6932+
scalar
6933+
Unbiased kurtosis.
6934+
6935+
See Also
6936+
--------
6937+
Series.skew : Return unbiased skew over requested axis.
6938+
Series.var : Return unbiased variance over requested axis.
6939+
Series.std : Return unbiased standard deviation over requested axis.
6940+
6941+
Examples
6942+
--------
6943+
>>> s = pd.Series([1, 2, 2, 3], index=["cat", "dog", "dog", "mouse"])
6944+
>>> s
6945+
cat 1
6946+
dog 2
6947+
dog 2
6948+
mouse 3
6949+
dtype: int64
6950+
>>> s.kurt()
6951+
1.5
6952+
"""
69066953
return NDFrame.kurt(
69076954
self, axis=axis, skipna=skipna, numeric_only=numeric_only, **kwargs
69086955
)

0 commit comments

Comments
 (0)