Concept Flow - nlargest() and nsmallest()
Start with DataFrame
Call nlargest(n, column)
→Sort column descending
Select top n rows
Call nsmallest(n, column)
→Sort column ascending
Select bottom n rows
Return subset DataFrame
Start with a DataFrame, then use nlargest() to get top n rows by a column sorted descending, or nsmallest() to get bottom n rows sorted ascending, returning those rows.