Sorting and Top Lists

sort_values puts a table's rows in order by one column or several, with ascending= saying which way for each; nlargest and nsmallest give the top or bottom rows by a column in one call; and reset_index(drop=True) numbers a top list 0, 1, 2 instead of keeping the old row labels.

By

Updated

Cheat sheet: Sorting and Top Lists
Category
Data Analysis
Level
Apprentice
Tags
nlargest(), python, reset_index(), sort_values()