runtime
415 / 500
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.

Functionprice_list(products)
productsa DataFrame with stock_code, description, list_price, first_sold_at
Returnsa new DataFrame with exactly those three columns, in the required order

Loading your progress…

A price list, most expensive first — Python practice · Runtime