pandas_exercises icon indicating copy to clipboard operation
pandas_exercises copied to clipboard

Ex1 - Filterong and Sorting Data - Price is ill defined

Open simonkenny opened this issue 7 years ago • 2 comments

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.

simonkenny avatar Oct 10 '18 11:10 simonkenny

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?

guipsamora avatar Dec 08 '18 12:12 guipsamora

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

jonathanmcmahon avatar Aug 17 '19 16:08 jonathanmcmahon