Closed jano15 closed 7 years ago
Just encountered this exact issue. Wrapping the round - 1 with int() fixes the issue. Have you set up a pull request?
Seconded; I encountered this issue yesterday and luckily it's a quick fix. Hope to see a commit for this
Why was this closed without comment? Is this incorporated into the source code at this point?
Yep!
Excellent! Thanks @roryk
location: the file: credible_intervals.py, function: compute_credible_intervals.
in upper_bound_indx = round((1-alpha/2)*num_samples) - 1 .
I get as result for my sample for example 2732.0 . Now this value is used to get the value in sample samples[2732.0]
and then throws this exception: cred_interval = [samples[lower_bound_indx], samples[upper_bound_indx]] IndexError: only integers, slices (
:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indicesI think the comma is the problem
fix it with: cast as an integer