Allow functionality for single expparams value (introduction_to_bayes_smc.ipynb)#1
Allow functionality for single expparams value (introduction_to_bayes_smc.ipynb)#1cbevington wants to merge 1 commit intoQInfer:masterfrom
Conversation
Attribute error arises for the case of a single expparams value (N, number of coin flips, in this case) if not converted to a numpy array. Fixed with with np.asarray
|
Thanks, Connor! I'm wondering about this error you are getting because I'm not seeing it. |
|
I was talking with another guy from the lab and we were wondering if it was a problem with Python or the code itself. The problem in question is when Python then notes an attribute error, since it is asking for the shape of an integer in I just downloaded the latest qinfer files last week and I ran the script in Python 3.5 through Spyder and an IPython console, both yielding this error. However, strangely, in Python 2.7 through Spyder no error arises. So my guess is that this is a Python error and not a code error. Finally, an easier fix to the code to resolve the 3.5 error than I suggested would be to simply change |
|
The code in |
|
It appears so! Comparing the lib files from each version somehow the 3.5 version was without the improvements. I did a little investigating... for the 3.5 environment I downloaded QInfer directly from PyPI, and for 2.7 I downloaded it with Git and |
Attribute error arises when calling model.likelihood for the case of a single expparams value (N, number of coin flips, in this case) if not converted to a numpy array. Fixed with with np.asarray.