According to the API reference, kurt is not a method of the DataFrameGroupBy class, while mean and skew are.

This should work:

df.groupby('a').apply(pd.DataFrame.kurt)
Answer from IanS on Stack Overflow
🌐
Kaggle
kaggle.com › questions-and-answers › 73018
Why is kurtosis unavailable via agg() on GroupBy DataFrames? | Kaggle
I've been working on the Two Sigma competition and I tried to add Kurtosis to some aggregations I was doing, but it threw an error since it's apparently not available on GroupBy-ed DataFrames? See this StackOverflow answer and how it's not listed in the Pandas' documentation.
🌐
Bigquery
dataframes.bigquery.dev › reference › api › bigframes.pandas.api.typing.SeriesGroupBy.kurt.html
bigframes.pandas.api.typing.SeriesGroupBy.kurt — bigframes documentation
Kurtosis obtained using Fisher’s definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1. ... >>> lst = ['a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'b'] >>> ser = bpd.Series([0, 1, 1, 0, 0, 1, 2, 4, 5], index=lst) >>> ser.groupby(level=0).kurt() a -6.0 b -1.963223 dtype: Float64
🌐
Medium
medium.com › @atanudan › kurtosis-skew-function-in-pandas-aa63d72e20de
Kurtosis() & Skew() Function In Pandas | by Atanu Dan | Medium
September 16, 2020 - Skewness essentially measures the symmetry of the distribution, while kurtosis determines the heaviness of the distribution tails.
🌐
Bigquery
dataframes.bigquery.dev › reference › api › bigframes.pandas.api.typing.SeriesGroupBy.kurtosis.html
bigframes.pandas.api.typing.SeriesGroupBy.kurtosis — bigframes documentation
>>> lst = ['a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'b'] >>> ser = bpd.Series([0, 1, 1, 0, 0, 1, 2, 4, 5], index=lst) >>> ser.groupby(level=0).kurtosis() a -6.0 b -1.963223 dtype: Float64 · Parameters: numeric_only (bool, default False) – Include only float, int or boolean data. Returns: Variance of values within each group. Return type: bigframes.pandas.DataFrame or bigframes.pandas.Series ·
🌐
Google Cloud
cloud.google.com › python › documentation › reference › class dataframegroupby (2.24.0)
Class DataFrameGroupBy (2.24.0) | Python client library | Google Cloud
Kurtosis obtained using Fisher's definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1. Examples: >>> import bigframes.pandas as bpd >>> bpd.options.display.progress_bar = None >>> lst = ['a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'b'] >>> ser = bpd.Series([0, 1, 1, 0, 0, 1, 2, 4, 5], index=lst) >>> ser.groupby(level=0).kurt() a -6.0 b -1.963223 dtype: Float64 ·
Find elsewhere
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 1.5 › reference › api › pandas.DataFrame.kurtosis.html
pandas.DataFrame.kurtosis — pandas 1.5.2 documentation
Kurtosis obtained using Fisher’s definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1. ... Axis for the function to be applied on. For Series this parameter is unused and defaults to 0. ... Exclude NA/null values when computing the result. ... If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a Series. Deprecated since version 1.3.0: The level keyword is deprecated. Use groupby instead.
🌐
YouTube
youtube.com › knowledge base
Pandas : Kurtosis on groupby of pandas dataframe doesn't work - YouTube
Pandas : Kurtosis on groupby of pandas dataframe doesn't work [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Pandas : Kurtosis on gro...
Published: February 12, 2022
Views: 71
🌐
Apache
spark.apache.org › docs › latest › api › python › reference › pyspark.pandas › api › pyspark.pandas.DataFrame.kurtosis.html
pyspark.pandas.DataFrame.kurtosis — PySpark 4.2.0 documentation
Return unbiased kurtosis using Fisher’s definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1. ... Axis for the function to be applied on. ... Exclude NA/null values when computing the result. Changed in version 3.4.0: Supported including NA/null values. ... Include only float, int, boolean columns. False is not supported. This parameter is mainly for pandas compatibility.
🌐
Teradata
docs.teradata.com › r › 1YKutX2ODdO9ppo_fnguTA › 0wDSZLWp2pdAh8HzSkyknw
Teradata Developers Portal
Loading application · Promo placeholder · Tracking Consent Teradata.com · Developers · Getting Started · VantageCloud Lake Documentation AI Unlimited All Documentation · Downloads · Community · Teradata Community Technical Medium Blogs Github Stack Overflow · Try for free
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.core.groupby.DataFrameGroupBy.skew.html
pandas.core.groupby.DataFrameGroupBy.skew — pandas 2.3.3 documentation
>>> 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
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 1.5 › reference › api › pandas.Series.kurtosis.html
pandas.Series.kurtosis — pandas 1.5.3 documentation
Kurtosis obtained using Fisher’s definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1. ... Axis for the function to be applied on. For Series this parameter is unused and defaults to 0. ... Exclude NA/null values when computing the result. ... If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a scalar. Deprecated since version 1.3.0: The level keyword is deprecated. Use groupby instead.
🌐
Readthedocs
koalas.readthedocs.io › en › latest › reference › api › databricks.koalas.DataFrame.kurtosis.html
databricks.koalas.DataFrame.kurtosis — Koalas 1.8.2 documentation
DataFrame.kurtosis(axis: Union[int, str] = None, numeric_only: bool = None) → Union[int, float, str, bytes, decimal.Decimal, datetime.date, None, Series]¶
🌐
Studytonight
studytonight.com › pandas › pandas-dataframe-kurtosis-method
Pandas DataFrame kurtosis() Method - Studytonight
March 19, 2021 - Python pandas DataFrame.kurtosis() method. This method returns unbiased kurtosis over the requested axis. Kurtosis obtained using Fisher’s definition of kurtosis (kurtosis of normal == 0.0).