Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to solve cookie3.py from first edition #5

Open
LeonardoReyes opened this issue Jan 2, 2015 · 0 comments
Open

trying to solve cookie3.py from first edition #5

LeonardoReyes opened this issue Jan 2, 2015 · 0 comments

Comments

@LeonardoReyes
Copy link

Hello,

I have been trying to pull off exercise 2.1 to create the cookie example without replacement but after failing miserably I checked the GIT repository for ThinkBayes2, and found a code with the solution for the second edition....

To my surprise I saw that I was on the correct track, however when trying to re-write the solution for the first version of ThinkBayes I still could not make it work...

if I use the following to set the hypos

bowl1=dict(vanilla=30,chocolate=10)
bowl2=dict(vanilla=20,chocolate=20)
pmf=Cookie([bowl1, bowl2])

I get:

TypeError: unhashable type: 'dict'

If I use the following (as cookie3.py in ThinkBayes2 )

bowl1=Hist(dict(vanilla=30,chocolate=10))
bowl2=Hist(dict(vanilla=20,chocolate=20)) 

I get :

AttributeError: 'Hist' object has no attribute 'Normalize'

I really want to see the solution to this, any hint or suggestion will be really appreciated!

Many thanks!

Leo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant