pandas_exercises
pandas_exercises copied to clipboard
Ex1 - Filterong and Sorting Data - Price is ill defined
Steps 4 and 5 assume that each price has a unique price.
However, chipo[(chipo['item_name'] == 'Chicken Bowl') & (chipo['quantity'] == 1)].item_price.unique() returns array([10.98, 11.25, 8.75, 8.49, 8.19, 10.58, 8.5 ])
This is covered by the drop_duplicates, however is still misleading as they aren't duplicate with price.
Got it, this is probably due to extras on "choice_description" column influencing the final price. What would be your suggestion to improve the exercise?
Everyone knows that guac is gonna cost extra. :laughing:
This was my solution.
>>> chipo[(chipo["item_price"] > 10) & (chipo["quantity"] == 1)].item_name.nunique()
25