data-centric-computing / dcic-public

Repository for (for now) filing bug reports about DCIC.
19 stars 2 forks source link

[DCIC Book]: Pandas GROUP BY Example uses wrong column #67

Closed jjo32 closed 6 months ago

jjo32 commented 11 months ago

Contact Details

joann.ordille@gmail.com

Which Web page has the problem?

https://dcic-world.org/…https://dcic-world.org/2023-02-21/python-tables-Pandas.html#%28part._.Aggregating_and_.Grouping_.Columns%29

What's the problem?

Given the following text, the first group by should be grouping by 'discount' not 'delivery'.

In Pandas, we can do a computation like this using an operation called groupby. Here’s are two examples. The first reports how many sales (rows) were made with each discount code, while the second summarize the total number of tickets sold by discount code:

events.groupby('delivery').count() events.groupby('discount')['numtix'].sum()

What browser are you seeing the problem on?

No response

kfisler commented 6 months ago

Fixed, thanks! Apologies for the delay.

kfisler commented 6 months ago

eb3c2dbdfa41e48f89fba17dcf9e590298bce39b