Answers for "python: subset top 5 values in a column"

0

python: subset top 5 values in a column

# top n rows ordered by columns values
gapminder_2007.nlargest(10, 'var1')

# top n rows ordered by multiple column values
gapminder_2007.nlargest(10, ['var1','var2'])

# smallest rows ordered column values
gapminder_2007.nsmallest(3, 'var1')
Posted by: Guest on February-11-2021

Code answers related to "python: subset top 5 values in a column"

Python Answers by Framework

Browse Popular Code Answers by Language