AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.02k stars 11.31k forks source link

Solution is Wrong chap01soln.ipynb #205

Closed optimopium closed 3 months ago

optimopium commented 1 year ago

The solution to the following question in chap01soln.ipynb is wrong.

Question: What was the birthweight of the first baby born to the respondent with caseid 5012?

Current Answer: preg[preg.caseid==5012].birthwgt_lb

But Correct Answer: preg.loc[(preg.caseid==2298) & (pregordr==1), "totalwgt_lb"]

You are not considering the first baby born part of the question in the current solution.

AllenDowney commented 3 months ago

Yes, that's better. Thanks!