Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Update Kurt Docstr #20044

Merged
merged 9 commits into from
Mar 9, 2018
41 changes: 22 additions & 19 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,21 +906,23 @@ def skew(self, **kwargs):

Parameters
----------
kwargs : Under Review
**kwargs
Under Review.

Returns
-------
Series or DataFrame (matches input)
Like-indexed object containing the result of function application
Series or DataFrame
Returned object type is determined by the caller of the %(name)s
calculation

See Also
--------
pandas.Series.%(name)s
pandas.DataFrame.%(name)s
pandas.Series.kurtosis
pandas.DataFrame.kurtosis
scipy.stats.skew
scipy.stats.kurtosis
Series.%(name)s : Calling object with Series data
DataFrame.%(name)s : Calling object with DataFrames
Series.kurt : Equivalent method for Series
DataFrame.kurt : Equivalent method for DataFrame
scipy.stats.skew : Third moment of a probability density
scipy.stats.kurtosis : Reference SciPy method

Notes
-----
Expand All @@ -932,19 +934,20 @@ def skew(self, **kwargs):
four matching the equivalent function call using `scipy.stats`.

>>> arr = [1, 2, 3, 4, 999]
>>> fmt = "{0:.6f}" # limit the printed precision to 6 digits
>>> import scipy.stats
>>> print("{0:.6f}".format(scipy.stats.kurtosis(arr[:-1], bias=False)))
>>> print(fmt.format(scipy.stats.kurtosis(arr[:-1], bias=False)))
-1.200000
>>> print("{0:.6f}".format(scipy.stats.kurtosis(arr[1:], bias=False)))
>>> print(fmt.format(scipy.stats.kurtosis(arr[1:], bias=False)))
3.999946
>>> df = pd.DataFrame(arr)
>>> df.rolling(4).kurt()
0
0 NaN
1 NaN
2 NaN
3 -1.200000
4 3.999946
>>> s = pd.Series(arr)
>>> s.rolling(4).kurt()
0 NaN
1 NaN
2 NaN
3 -1.200000
4 3.999946
dtype: float64
""")

def kurt(self, **kwargs):
Expand Down