AllenDowney / ThinkStats2

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

Error in chap03ex.ipynb #63

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi, I noticed that in 7th cell when we are plotting the pmf, pmf instance should be updated in 6th cell. Not the hist instance.

n = hist.Total()
pmf = hist.Copy()
for x, freq in hist.Items():
    pmf[x] = freq / n
AllenDowney commented 7 years ago

Good catch! That should be fixed now. Thanks!

On Tue, Feb 21, 2017 at 11:05 AM, Khirod Kant Naik <notifications@github.com

wrote:

Hi, I noticed that in 7th cell when we are plotting the pmf, pmf instance should be updated in 6th cell. Not the hist instance.

n = hist.Total() pmf = hist.Copy() for x, freq in hist.Items(): pmf[x] = freq / n

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/63, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37QgbSVljS1WFKADH_2-l_KJ77qO1ks5rewtbgaJpZM4MHgwG .