AllenDowney / ThinkBayes2

Text and code for the forthcoming second edition of Think Bayes, by Allen Downey.
http://allendowney.github.io/ThinkBayes2/
MIT License
1.8k stars 1.49k forks source link

Chapter 8 - unexpected overlapping curves #71

Closed vitorvilela closed 9 months ago

vitorvilela commented 9 months ago

Working with the notebook of Chapter 8, I needed to change the line

france = prior.copy()

by

from copy import copy
france = copy(prior)

or

france = prior.copy(deep=True) to work properly with the copy method of the Pmf class.

Otherwise, the curves will overlap.

PS.: Initially I thought it was returning a reference, but the object ids are different. In my case:

id(prior): 139718265739216
id(france): 139718228051664
AllenDowney commented 9 months ago

This was an error in version 0.7.1 of empiricaldist.

I have pushed version 0.7.2, which should work now -- just make sure you have the latest version.

Thanks for letting me know!