Skip to content

02: Filtering and Sorting/Chipotle, Step-4 & 5 #65

Open
@realyashnag

Description

@realyashnag

In 02-Filtering_and_Sorting/Chipotle, step 4 and 5,

  • Solution doesn't consider items which do not have a 'quantity'==1 in the data
  • They can be extracted by
    chipo['item_price'] = chipo['item_price']/chipo['quantity']
    chipo['quantity'] = 1 #Dividing item_price by quantity, therefore let quantity be 1
    chipo.drop_duplicates(['item_name'], keep='first', inplace=True)
    chipo.sort_values(by='item_price', ascending=False, inplace=True)
    display(chipo[['item_name', 'item_price']])

I'm also a beginner at Pandas, please let me know about any stupid thing that I missed. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions