Answers for "pandas top 10 values of a column"

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
Posted by: Guest on May-07-2021
-2

pandas top 10 values of a column

df.sort_values(['item', 'value'], ascending=False).groupby('item').head(10)
Posted by: Guest on February-10-2021

Code answers related to "pandas top 10 values of a column"

Python Answers by Framework

Browse Popular Code Answers by Language