SeriesGroupBy.nlargest()

pandas.core.groupby.SeriesGroupBy.nlargest

SeriesGroupBy.nlargest(*args, **kwargs)

Return the largest n elements.

Parameters:

n : int

Return this many descending sorted values

keep : {‘first’, ‘last’, False}, default ‘first’

Where there are duplicate values: - first : take the first occurrence. - last : take the last occurrence.

take_last : deprecated

Returns:

top_n : Ser