-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Update Kurt Docstr #20044
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
Changes from 1 commit
ab1b1ad
d08faa7
471499b
01ecb99
2fb4011
efa7026
adf81ea
ffaa01f
083d0e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -910,8 +910,9 @@ def skew(self, **kwargs): | |
|
||
Returns | ||
------- | ||
Series or DataFrame (matches input) | ||
Like-indexed object containing the result of function application | ||
Series or DataFrame | ||
Returned object type is dictated by the caller of the %(name)s | ||
calculation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. align with the "Returned .." from above |
||
|
||
See Also | ||
-------- | ||
|
@@ -932,19 +933,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 | ||
>>> ser = pd.Series(arr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm OK I didn't see that. I would actually prefer |
||
>>> ser.rolling(4).kurt() | ||
0 NaN | ||
1 NaN | ||
2 NaN | ||
3 -1.200000 | ||
4 3.999946 | ||
dtype: float64 | ||
""") | ||
|
||
def kurt(self, **kwargs): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a non-native speaker, I found your original "determined" better than "dictated" (but maybe not more correct :-)). Or simpler "Returned object is of the same type as the caller ..." ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I was trying to be as literal as possible so I didn't want to say caller, since that's technically either the
Rolling
orExpanding
object. I'll revert to determined - not that semantically different