Comments (4)
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.
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.
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.
Fixed with last PRs.
from pandas_exercises.
Related Issues (20)
- Question: Is Step 9 solution correct? HOT 1
- Can I translate this code into Korean and post it on my blog?
- Getting Financial Data - Pandas Datareader - Step 8 Solution HOT 1
- 01_Getting_&_Knowing_Your_Data - Chipotle - Total Revenue Incorrect HOT 1
- Pandas Application HOT 1
- 'Chips and Roasted Chili-Corn Salsa' and 'Chips and Roasted Chili Corn Salsa' is duplicated?
- 02 Filtering on Euro 12
- impossible to type code in windows. What is fail? HOT 1
- Missing β09_Time_SeriesGetting_Financial_Dataβ solution code HOT 1
- Faster Alternative to 01_Getting_&_Knowing_Your_Data - World Food Facts Step 11
- Alternative to pandas_exercises/03_Grouping/Occupation/ Step 8
- 01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb - Step 13.b : Incorrect solution? HOT 1
- What's the code is about
- f
- new code issue
- pandas_exercises/03_Grouping/Occupation /Exercises_with_solutions.ipynb video link not working
- small typos
- error in 03_Grouping/Alcohol_Consumption/Exercise_with_solutions.ipynb
- Very good source to practise pandas
- Learning Python for self
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas_exercises.