@@ -12095,14 +12095,87 @@ def skew(
12095
12095
) -> Series | Any : ...
12096
12096
12097
12097
@deprecate_nonkeyword_arguments (version = "3.0" , allowed_args = ["self" ], name = "skew" )
12098
- @doc (make_doc ("skew" , ndim = 2 ))
12099
12098
def skew (
12100
12099
self ,
12101
12100
axis : Axis | None = 0 ,
12102
12101
skipna : bool = True ,
12103
12102
numeric_only : bool = False ,
12104
12103
** kwargs ,
12105
12104
) -> Series | Any :
12105
+ """
12106
+ Return unbiased skew over requested axis.
12107
+
12108
+ Normalized by N-1.
12109
+
12110
+ Parameters
12111
+ ----------
12112
+ axis : {index (0), columns (1)}
12113
+ Axis for the function to be applied on.
12114
+ For `Series` this parameter is unused and defaults to 0.
12115
+
12116
+ For DataFrames, specifying ``axis=None`` will apply the aggregation
12117
+ across both axes.
12118
+
12119
+ .. versionadded:: 2.0.0
12120
+
12121
+ skipna : bool, default True
12122
+ Exclude NA/null values when computing the result.
12123
+ numeric_only : bool, default False
12124
+ Include only float, int, boolean columns.
12125
+
12126
+ **kwargs
12127
+ Additional keyword arguments to be passed to the function.
12128
+
12129
+ Returns
12130
+ -------
12131
+ Series or scalar
12132
+ Unbiased skew over requested axis.
12133
+
12134
+ See Also
12135
+ --------
12136
+ Dataframe.kurt : Returns unbiased kurtosis over requested axis.
12137
+
12138
+ Examples
12139
+ --------
12140
+ >>> s = pd.Series([1, 2, 3])
12141
+ >>> s.skew()
12142
+ 0.0
12143
+
12144
+ With a DataFrame
12145
+
12146
+ >>> df = pd.DataFrame(
12147
+ ... {"a": [1, 2, 3], "b": [2, 3, 4], "c": [1, 3, 5]},
12148
+ ... index=["tiger", "zebra", "cow"],
12149
+ ... )
12150
+ >>> df
12151
+ a b c
12152
+ tiger 1 2 1
12153
+ zebra 2 3 3
12154
+ cow 3 4 5
12155
+ >>> df.skew()
12156
+ a 0.0
12157
+ b 0.0
12158
+ c 0.0
12159
+ dtype: float64
12160
+
12161
+ Using axis=1
12162
+
12163
+ >>> df.skew(axis=1)
12164
+ tiger 1.732051
12165
+ zebra -1.732051
12166
+ cow 0.000000
12167
+ dtype: float64
12168
+
12169
+ In this case, `numeric_only` should be set to `True` to avoid
12170
+ getting an error.
12171
+
12172
+ >>> df = pd.DataFrame(
12173
+ ... {"a": [1, 2, 3], "b": ["T", "Z", "X"]}, index=["tiger", "zebra", "cow"]
12174
+ ... )
12175
+ >>> df.skew(numeric_only=True)
12176
+ a 0.0
12177
+ dtype: float64
12178
+ """
12106
12179
result = super ().skew (
12107
12180
axis = axis , skipna = skipna , numeric_only = numeric_only , ** kwargs
12108
12181
)
0 commit comments