question 415 pandas Foundations · medium
A price list, most expensive first
Write price_list(products): from a products DataFrame, return a new DataFrame with only stock_code, description and list_price, ordered by list_price from highest to lowest; products with the same price are ordered by stock_code, A to Z.
Function
price_list(products)productsa DataFrame with
stock_code, description, list_price, first_sold_atReturnsa new DataFrame with exactly those three columns, in the required order