jakevdp / PythonicPerambulations

Old source for jakevdp.github.io. New source at http://github.com/jakevdp/jakevdp.github.io-source
89 stars 72 forks source link

tiny python3 syntax fix for notebooks/FreqBayes.ipynb (cell 11) #8

Open stonebig opened 8 years ago

stonebig commented 8 years ago

Some parenthesis are missing to make it Python 3 compatible


print (" mu    = {0:.0f} +/- {1:.0f}".format(mu_samp.mean(), mu_samp.std()))
print (" sigma = {0:.0f} +/- {1:.0f}".format(sig_samp.mean(), sig_samp.std()))
stonebig commented 8 years ago

also in FreqBayes3.ipynb cell 6 (and 7, and after):

# Now we ask how many of these mu values fall in our credible region
mu_good = mu[i]
CR = bayes_CR_mu(D, 10)
within_CR = (CR[0] < mu_good) & (mu_good < CR[1])
print ("Fraction of means in Credible Region: {0:.3f}".format(within_CR.sum() * 1. / within_CR.size))