Writing as you said obs=[1,2,3,4]
also shows me the same error. I am with Python 3.7, PyMC 4.0.1 and arviz 0.12.1.
The entire error message for obs = 10
:
TypeError Traceback (most recent call last)
TypeError: expected dtype object, got 'numpy.dtype[int64]'
The above exception was the direct cause of the following exception:
SystemError Traceback (most recent call last)
<ipython-input-18-e50dab2a9772> in <module>
1 #data_ppc.posterior_predictive = data_ppc.posterior_predictive.squeeze()
----> 2 az.plot_ppc(trace, kind="scatter")
/usr/local/apps/gcc/7.3.0/python/3.7.4.1/lib/python3.7/site-packages/arviz/plots/ppcplot.py in plot_ppc(data, kind, alpha, mean, observed, color, colors, grid, figsize, textsize, data_pairs, var_names, filter_vars, coords, flatten, flatten_pp, num_pp_samples, random_seed, jitter, animated, animation_kwargs, legend, labeller, ax, backend, backend_kwargs, group, show)
354 # TODO: Add backend kwargs
355 plot = get_plotting_function("plot_ppc", "ppcplot", backend)
--> 356 axes = plot(**ppcplot_kwargs)
357 return axes
/usr/local/apps/gcc/7.3.0/python/3.7.4.1/lib/python3.7/site-packages/arviz/plots/backends/matplotlib/ppcplot.py in plot_ppc(ax, length_plotters, rows, cols, figsize, animated, obs_plotters, pp_plotters, predictive_dataset, pp_sample_ix, kind, alpha, colors, textsize, mean, observed, jitter, total_pp_samples, legend, labeller, group, animation_kwargs, num_pp_samples, backend_kwargs, show)
288 vals = pp_vals.flatten()
289 bins = get_bins(vals)
--> 290 _, hist, bin_edges = histogram(vals, bins=bins)
291 hist = np.concatenate((hist[:1], hist))
292 ax_i.plot(
/usr/local/apps/gcc/7.3.0/python/3.7.4.1/lib/python3.7/site-packages/arviz/utils.py in __call__(self, *args, **kwargs)
193 """Call the jitted function or normal, depending on flag."""
194 if Numba.numba_flag:
--> 195 return self.numba_fn(*args, **kwargs)
196 else:
197 return self.function(*args, **kwargs)
SystemError: CPUDispatcher(<function histogram at 0x7f523df178c0>) returned a result with an error set