Trace plot from cmdstan results in IndexError: arrays used as indices must be of integer (or boolean) type
See original GitHub issueI can’t plot the trace plot from cmdstan
ID = 3
posterior_glob = "./samplesID_%d-[1-9].csv"%ID
obs_data_path = "./DataID_%d.R"%ID
cmdstan_data = az.from_cmdstan(posterior = posterior_glob, observed_data=obs_data_path)
pars = ["R0","kappa"]
az.plot_trace(cmdstan_data,var_names=pars)
which results in
/home/XXX/arviz/plots/kdeplot.py:326: RuntimeWarning: invalid value encountered in true_divide
def _fast_kde_2d(x, y, gridsize=(128, 128), circular=False):
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-145-9641094159ee> in <module>
----> 1 az.plot_trace(cmdstan_data,var_names=pars)
~/anaconda3/lib/python3.6/site-packages/arviz/plots/traceplot.py in plot_trace(data, var_names, coords, divergences, figsize, textsize, lines, compact, combined, legend, plot_kwargs, fill_kwargs, rug_kwargs, hist_kwargs, trace_kwargs, max_plots)
IndexError: arrays used as indices must be of integer (or boolean) type
I can get density_plot with no problems, but trace plot does not work. It shows the first subplot for R0, but then displays the error.
Additional context Stable version 0.5.1 installed via pip-command
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Python,IndexError: arrays used as indices must be of integer ...
the problem was solved just by converting the float array into int ... select the elements in a different way than boolean index...
Read more >IndexError: arrays used as indices must be of integer ... - GitHub
IndexError : arrays used as indices must be of integer (or boolean) ... Could you put some print() to see the type and...
Read more >Arrays Used as Indices Must Be of Integer (Or Boolean) Type
The arrays used as indices must be of integer (or Boolean) type error is related to Numpy arrays. Click here to learn why...
Read more >Solve IndexError: Arrays Used as Indices Must Be of Integer ...
This tutorial describes how to solve IndexError: arrays used as indices must be of integer (or boolean) type in Python.
Read more >arrays used as indices must be of integer (or boolean) type"?
How to fix this "IndexError: arrays used as indices must be of ... Build the forward propagation in the tensorflow graph ### START...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, there is an error in
from_cmdstan
where part of the sample_stats items arefloat
(they should beint
orbool
).The quick fix to plot your results is
Thanks!