pandas.core.groupby.SeriesGroupBy.nlargest

Return the largest n elements.

param n
int, default 5

Return this many descending sorted values.

param keep
{‘first’, ‘last’, ‘all’}, default ‘first’

When there are duplicate values that cannot all fit in a Series of n elements:

  • firstreturn the first n occurrences in order

    of appearance.

  • lastreturn the last n occurrences in reverse

    order of appearance.

  • allkeep all occurrences. This can result in a Series of

    size larger than n.

return

Series The n largest values in the Series, sorted in decreasing order.

Warning

This feature is currently unsupported by Intel Scalable Dataframe Compiler