get top 10 values in dataframe code example
Example 1: pandas find top 10 values in column
#df.nlargest(How many largest Values, 'Col_name')
>>> df.nlargest(3, 'a')
a b c
3 11 c 3
1 10 b 2
2 8 d NaN
Example 2: only get top 10 python dataframe
df[df['Ticket'] == 1].sort_values('Age')['Names'].head(10)
Example 3: pandas top 10 values of a column
df.sort_values(['item', 'value'], ascending=False).groupby('item').head(10)