Git Product home page Git Product logo

Comments (4)

JTBooth avatar JTBooth commented on May 11, 2024

The groupby(...)sum() code is accounting for item_count. Chicken bowls were ordered 726 times, but 35 of those were for 2 chicken bowls.

from pandas_exercises.

kartikgiri92 avatar kartikgiri92 commented on May 11, 2024

chipo["item_name"] makes a series...
chipo["item_name"].value_counts....gives the number of times each item is present in that series.
Meanwhile chipo.groupby("item_name")..makes an object and then adding the sum function further to it adds the quantity column for each time the item is present.
So basically value_counts adds the number of time item is present in "item_name" column and group_by().sum() add the quantity column elements for the items.

from pandas_exercises.

Serg132003 avatar Serg132003 commented on May 11, 2024

Sorry - didn't get it. I count max using chipo['item_name'].value_counts() and got 726 items. Method, shown in exercise gives 761. When I actually check original file in excel it gives me 726 as well. What is right way to count and how did this error appear?

from pandas_exercises.

guipsamora avatar guipsamora commented on May 11, 2024

Fixed with last PRs.

from pandas_exercises.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.