Skip to content

Commit c730d08

Browse files
WillAydjorisvandenbossche
authored andcommitted
DOC: Update Kurt Docstr (pandas-dev#20044)
1 parent 9119d07 commit c730d08

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

pandas/core/window.py

+22-19
Original file line numberDiff line numberDiff line change
@@ -906,21 +906,23 @@ def skew(self, **kwargs):
906906
907907
Parameters
908908
----------
909-
kwargs : Under Review
909+
**kwargs
910+
Under Review.
910911
911912
Returns
912913
-------
913-
Series or DataFrame (matches input)
914-
Like-indexed object containing the result of function application
914+
Series or DataFrame
915+
Returned object type is determined by the caller of the %(name)s
916+
calculation
915917
916918
See Also
917919
--------
918-
pandas.Series.%(name)s
919-
pandas.DataFrame.%(name)s
920-
pandas.Series.kurtosis
921-
pandas.DataFrame.kurtosis
922-
scipy.stats.skew
923-
scipy.stats.kurtosis
920+
Series.%(name)s : Calling object with Series data
921+
DataFrame.%(name)s : Calling object with DataFrames
922+
Series.kurt : Equivalent method for Series
923+
DataFrame.kurt : Equivalent method for DataFrame
924+
scipy.stats.skew : Third moment of a probability density
925+
scipy.stats.kurtosis : Reference SciPy method
924926
925927
Notes
926928
-----
@@ -932,19 +934,20 @@ def skew(self, **kwargs):
932934
four matching the equivalent function call using `scipy.stats`.
933935
934936
>>> arr = [1, 2, 3, 4, 999]
937+
>>> fmt = "{0:.6f}" # limit the printed precision to 6 digits
935938
>>> import scipy.stats
936-
>>> print("{0:.6f}".format(scipy.stats.kurtosis(arr[:-1], bias=False)))
939+
>>> print(fmt.format(scipy.stats.kurtosis(arr[:-1], bias=False)))
937940
-1.200000
938-
>>> print("{0:.6f}".format(scipy.stats.kurtosis(arr[1:], bias=False)))
941+
>>> print(fmt.format(scipy.stats.kurtosis(arr[1:], bias=False)))
939942
3.999946
940-
>>> df = pd.DataFrame(arr)
941-
>>> df.rolling(4).kurt()
942-
0
943-
0 NaN
944-
1 NaN
945-
2 NaN
946-
3 -1.200000
947-
4 3.999946
943+
>>> s = pd.Series(arr)
944+
>>> s.rolling(4).kurt()
945+
0 NaN
946+
1 NaN
947+
2 NaN
948+
3 -1.200000
949+
4 3.999946
950+
dtype: float64
948951
""")
949952

950953
def kurt(self, **kwargs):

0 commit comments

Comments
 (0)