Repository: pandas-dev/pandas
File: pandas/core/groupby/generic.py (Python)

Code before:
        Parrot     40.0
        Parrot     41.0
        Name: Max Speed, dtype: float64
        >>> ser.groupby(level=0).kurt()
        Falcon    1.622109
        Parrot   -2.878714
        Name: Max Speed, dtype: float64
        >>> ser.groupby(level=0).kurt(skipna=False)
        Falcon         NaN
        Parrot   -2.878714
        Name: Max Speed, dtype: float64
        """

        def alt(obj):
            # This should not be reached since the cython path should raise
            #  TypeError and not NotImplementedError.
            raise TypeError(f"'kurt' is not supported for dtype={obj.dtype}")

        return self._cython_agg_general(
            "kurt", alt=alt, skipna=skipna, numeric_only=numeric_only, **kwargs
        )

    @property
    def plot(self) -> GroupByPlot:
        """
        Make plots of SeriesGroupBy.

        Uses the backend specified by the option ``plotting.backend``.
        By default, matplotlib is used.

        Returns
        -------
        GroupByPlot
            A plotting object that can be used to create plots for each group.

        See Also
        --------
        Series.plot : Make plots of Series.

        Examples
        --------
        >>> ser = pd.Series([1, 2, 3, 4, 5], index=["a", "a", "b", "b", "c"])
        >>> g = ser.groupby(level=0)
        >>> g.plot()  # doctest: +SKIP
        """
        result = GroupByPlot(self)
        return result

    @doc(Series.nlargest.__doc__)
    def nlargest(
        self, n: int = 5, keep: Literal["first", "last", "all"] = "first"

Review comment (suggestion):
```suggestion
        Make plots of groups from a Series.
```

Code after:
        Parrot     40.0
        Parrot     41.0
        Name: Max Speed, dtype: float64
        >>> ser.groupby(level=0).kurt()
        Falcon    1.622109
        Parrot   -2.878714
        Name: Max Speed, dtype: float64
        >>> ser.groupby(level=0).kurt(skipna=False)
        Falcon         NaN
        Parrot   -2.878714
        Name: Max Speed, dtype: float64
        """

        def alt(obj):
            # This should not be reached since the cython path should raise
            #  TypeError and not NotImplementedError.
            raise TypeError(f"'kurt' is not supported for dtype={obj.dtype}")

        return self._cython_agg_general(
            "kurt", alt=alt, skipna=skipna, numeric_only=numeric_only, **kwargs
        )

    @property
    def plot(self) -> GroupByPlot:
        """
        Make plots of groups from a Series.

        Uses the backend specified by the option ``plotting.backend``.
        By default, matplotlib is used.

        Returns
        -------
        GroupByPlot
            A plotting object that can be used to create plots for each group.

        See Also
        --------
        Series.plot : Make plots of Series.

        Examples
        --------
        >>> ser = pd.Series([1, 2, 3, 4, 5], index=["a", "a", "b", "b", "c"])
        >>> g = ser.groupby(level=0)
        >>> g.plot()  # doctest: +SKIP
        """
        result = GroupByPlot(self)
        return result

    @doc(Series.nlargest.__doc__)
    def nlargest(
        self, n: int = 5, keep: Literal["first", "last", "all"] = "first"