Open takatex opened 6 years ago
+1. I was about to submit a PR for the same issue. I fixed it slightly differently:
samples = [lambda_1.random().item() for i in range(20000)]
Can also be:
samples = [lambda_1.random().item(0) for i in range(20000)]
What I don't quite follow is why the usual Python index selection syntax doesn't work. This might only be an issue with certain platforms.
Hello,
first, many thanks for your good documents.
In 'Ch2_MorePyMC_PyMC3.ipynb', I modified a part of the code from
to
lambda_1.random()
return "array(value)" and the shape is()
, solambda_1.random()[0]
generate an error("too many indices for array") in original code. So, I modified the code to change the value type from "numpy.ndarray" to "numpy.float64" by usingflat[0]
.postscript
I modified it again