Skip to content

Commit

Permalink
DOC: add RT03,SA01 for pandas.Series.kurt and pandas.Series.kurtosis (#…
Browse files Browse the repository at this point in the history
…58761)

* DOC: add RT03,SA01 for pandas.Series.kurt

* DOC: remove RT03,SA01 for pandas.Series.kurt
  • Loading branch information
tuhinsharma121 committed May 18, 2024
1 parent 058127c commit 33682b5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
49 changes: 48 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -6895,14 +6895,61 @@ 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,
skipna: bool = True,
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
)
Expand Down

0 comments on commit 33682b5

Please sign in to comment.