Return unbiased skew within groups.
Normalized by N-1.
Axis for the function to be applied on.
Specifying axis=None will apply the aggregation across both axes.
Added in version 2.0.0.
Deprecated since version 2.1.0: For axis=1, operate on the underlying object instead. Otherwise the axis keyword is not necessary.
Exclude NA/null values when computing the result.
Include only float, int, boolean columns.
Additional keyword arguments to be passed to the function.
See also
DataFrame.skewReturn unbiased skew over requested axis.
Examples
>>> arrays = [['falcon', 'parrot', 'cockatoo', 'kiwi',
... 'lion', 'monkey', 'rabbit'],
... ['bird', 'bird', 'bird', 'bird',
... 'mammal', 'mammal', 'mammal']]
>>> index = pd.MultiIndex.from_arrays(arrays, names=('name', 'class'))
>>> df = pd.DataFrame({'max_speed': [389.0, 24.0, 70.0, np.nan,
... 80.5, 21.5, 15.0]},
... index=index)
>>> df
max_speed
name class
falcon bird 389.0
parrot bird 24.0
cockatoo bird 70.0
kiwi bird NaN
lion mammal 80.5
monkey mammal 21.5
rabbit mammal 15.0
>>> gb = df.groupby(["class"])
>>> gb.skew()
max_speed
class
bird 1.628296
mammal 1.669046
>>> gb.skew(skipna=False)
max_speed
class
bird NaN
mammal 1.669046
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.core.groupby.DataFrameGroupBy.skew.html