-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: add documentation to DataFrameGroupBy.skew and SeriesGroupBy.skew #50958
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
Changes from 1 commit
42cb9dd
032fa5f
97823a6
7ace24e
3e1bc24
2a413ac
1701d1f
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 |
---|---|---|
|
@@ -1001,14 +1001,42 @@ def take( | |
result = self._op_via_apply("take", indices=indices, axis=axis, **kwargs) | ||
return result | ||
|
||
@doc(Series.skew.__doc__) | ||
def skew( | ||
self, | ||
axis: Axis | lib.NoDefault = lib.no_default, | ||
skipna: bool = True, | ||
numeric_only: bool = False, | ||
**kwargs, | ||
) -> Series: | ||
""" | ||
Return unbiased skew within groups.\n\nNormalized by N-1. | ||
|
||
Parameters | ||
---------- | ||
axis : {axis_descr} | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Axis for the function to be applied on. | ||
For `Series` this parameter is unused and defaults to 0. | ||
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. For reST, there should be two backticks,
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. Maybe it makes sense to write the same for 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. I think numeric_only is slightly different - if you specify |
||
|
||
For DataFrames, specifying ``axis=None`` will apply the aggregation | ||
across both axes. | ||
|
||
.. versionadded:: 2.0.0 | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
skipna : bool, default True | ||
Exclude NA/null values when computing the result. | ||
numeric_only : bool, default False | ||
Include only float, int, boolean columns. Not implemented for Series. | ||
Comment on lines
+1030
to
+1031
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.
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. I'm seeing numeric_only functioning here:
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. I can reproduce this. However, when I run this
I get the following error:
When I set 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. Ah - I didn't realize you were referring to Series here. It is true that operating on a non-numeric Series will always fail with skew, and as far as I know this is consistent across Series and SeriesGroupBy ops. Perhaps there is a better behavior or the argument should be removed, but I think that's for a separate issue. |
||
|
||
{min_count}\ | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
**kwargs | ||
Additional keyword arguments to be passed to the function. | ||
|
||
Returns | ||
------- | ||
{name1} or scalar\ | ||
{see_also}\ | ||
{examples} | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
result = self._op_via_apply( | ||
"skew", | ||
axis=axis, | ||
|
@@ -2470,14 +2498,42 @@ def take( | |
result = self._op_via_apply("take", indices=indices, axis=axis, **kwargs) | ||
return result | ||
|
||
@doc(DataFrame.skew.__doc__) | ||
def skew( | ||
self, | ||
axis: Axis | None | lib.NoDefault = lib.no_default, | ||
skipna: bool = True, | ||
numeric_only: bool = False, | ||
**kwargs, | ||
) -> DataFrame: | ||
""" | ||
Return unbiased skew within groups.\n\nNormalized by N-1. | ||
|
||
Parameters | ||
---------- | ||
axis : {axis_descr} | ||
Axis for the function to be applied on. | ||
For `Series` this parameter is unused and defaults to 0. | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
For DataFrames, specifying ``axis=None`` will apply the aggregation | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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. Not implemented for Series. | ||
rhshadrach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{min_count}\ | ||
**kwargs | ||
Additional keyword arguments to be passed to the function. | ||
|
||
Returns | ||
------- | ||
{name1} or scalar\ | ||
{see_also}\ | ||
{examples} | ||
""" | ||
result = self._op_via_apply( | ||
"skew", | ||
axis=axis, | ||
|
Uh oh!
There was an error while loading. Please reload this page.